diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/embedded/desktopservices/contenttab.cpp | 6 | ||||
-rw-r--r-- | examples/embedded/desktopservices/contenttab.h | 5 | ||||
-rw-r--r-- | examples/embedded/desktopservices/desktopwidget.cpp | 8 |
3 files changed, 10 insertions, 9 deletions
diff --git a/examples/embedded/desktopservices/contenttab.cpp b/examples/embedded/desktopservices/contenttab.cpp index 49c1260..d1a2832 100644 --- a/examples/embedded/desktopservices/contenttab.cpp +++ b/examples/embedded/desktopservices/contenttab.cpp @@ -66,7 +66,7 @@ ContentTab::~ContentTab() } // NEW PUBLIC METHODS -void ContentTab::init(const QDesktopServices::StandardLocation &location, +void ContentTab::init(const QStandardPaths::StandardLocation &location, const QString &filter, const QString &icon) { @@ -83,9 +83,9 @@ void ContentTab::init(const QDesktopServices::StandardLocation &location, } // NEW PROTECTED METHODS -void ContentTab::setContentDir(const QDesktopServices::StandardLocation &location) +void ContentTab::setContentDir(const QStandardPaths::StandardLocation &location) { - m_ContentDir.setPath(QDesktopServices::storageLocation(location)); + m_ContentDir.setPath(QStandardPaths::writableLocation(location)); } void ContentTab::setIcon(const QString &icon) diff --git a/examples/embedded/desktopservices/contenttab.h b/examples/embedded/desktopservices/contenttab.h index 614f42a..191d12e 100644 --- a/examples/embedded/desktopservices/contenttab.h +++ b/examples/embedded/desktopservices/contenttab.h @@ -49,6 +49,7 @@ #include <QFileInfo> #include <QListWidget> #include <QDesktopServices> +#include <QStandardPaths> // INTERNAL INCLUDES @@ -73,12 +74,12 @@ public: // Constructors & Destructors virtual ~ContentTab(); public: // New Methods - virtual void init(const QDesktopServices::StandardLocation &location, + virtual void init(const QStandardPaths::StandardLocation &location, const QString &filter, const QString &icon); protected: // New Methods - virtual void setContentDir(const QDesktopServices::StandardLocation &location); + virtual void setContentDir(const QStandardPaths::StandardLocation &location); virtual void setIcon(const QString &icon); virtual void populateListWidget(); virtual QString itemName(const QFileInfo &item); diff --git a/examples/embedded/desktopservices/desktopwidget.cpp b/examples/embedded/desktopservices/desktopwidget.cpp index d34bb98..7056ac9 100644 --- a/examples/embedded/desktopservices/desktopwidget.cpp +++ b/examples/embedded/desktopservices/desktopwidget.cpp @@ -42,7 +42,7 @@ // EXTERNAL INCLUDES #include <QTabWidget> #include <QVBoxLayout> -#include <QDesktopServices> +#include <QStandardPaths> // INTERNAL INCLUDES #include "linktab.h" @@ -59,14 +59,14 @@ DesktopWidget::DesktopWidget(QWidget *parent) : QWidget(parent) // Images ContentTab* imageTab = new ContentTab(tabWidget); - imageTab->init(QDesktopServices::PicturesLocation, + imageTab->init(QStandardPaths::PicturesLocation, "*.png;*.jpg;*.jpeg;*.bmp;*.gif", ":/resources/photo.png"); tabWidget->addTab(imageTab, tr("Images")); // Music ContentTab* musicTab = new ContentTab(tabWidget); - musicTab->init(QDesktopServices::MusicLocation, + musicTab->init(QStandardPaths::MusicLocation, "*.wav;*.mp3;*.mp4", ":/resources/music.png"); tabWidget->addTab(musicTab, tr("Music")); @@ -74,7 +74,7 @@ DesktopWidget::DesktopWidget(QWidget *parent) : QWidget(parent) // Links LinkTab* othersTab = new LinkTab(tabWidget);; // Given icon file will be overridden by LinkTab - othersTab->init(QDesktopServices::PicturesLocation, "", ""); + othersTab->init(QStandardPaths::PicturesLocation, "", ""); tabWidget->addTab(othersTab, tr("Links")); // Layout |