diff options
author | Carlos Bohórquez <carlos@kernelmap.com> | 2015-09-11 15:06:27 +0200 |
---|---|---|
committer | Carlos Bohórquez <carlos@kernelmap.com> | 2015-09-11 15:06:27 +0200 |
commit | ad713efa6f6232422d9e88095e8313383fed64db (patch) | |
tree | 43e14745ba75b04a1ea657250ef056daaa5c7067 /lumina-fm/widgets | |
parent | Several changes (diff) | |
download | lumina-ad713efa6f6232422d9e88095e8313383fed64db.tar.gz lumina-ad713efa6f6232422d9e88095e8313383fed64db.tar.bz2 lumina-ad713efa6f6232422d9e88095e8313383fed64db.zip |
Static variables not needed now
Diffstat (limited to 'lumina-fm/widgets')
-rw-r--r-- | lumina-fm/widgets/DirWidget.cpp | 39 | ||||
-rw-r--r-- | lumina-fm/widgets/DirWidget.h | 6 |
2 files changed, 20 insertions, 25 deletions
diff --git a/lumina-fm/widgets/DirWidget.cpp b/lumina-fm/widgets/DirWidget.cpp index 7954cc8e..6c1c4553 100644 --- a/lumina-fm/widgets/DirWidget.cpp +++ b/lumina-fm/widgets/DirWidget.cpp @@ -29,8 +29,6 @@ const QString sessionsettings_config_file = QDir::homePath() + "/.lumina/LuminaDE/sessionsettings.conf"; -QStringList DirWidget::date_format = QStringList(); - DirWidget::DirWidget(QString objID, QWidget *parent) : QWidget(parent), ui(new Ui::DirWidget){ ui->setupUi(this); //load the designer file ID = objID; @@ -162,6 +160,23 @@ void DirWidget::setShowCloseButton(bool show){ ui->actionClose_Browser->setVisible(show); } +QStringList DirWidget::getDateFormat() { + return date_format; +} + +// This function is only called if user changes sessionsettings. By doing so, operations like sorting by date +// are faster because the date format is already stored in DirWidget::date_format static variable +void DirWidget::setDateFormat() { + if(!date_format.isEmpty()) + date_format.clear(); + QSettings settings("LuminaDE","sessionsettings"); + QString date, time; + // If value doesn't exist or is not setted, empty string is returned + date_format << settings.value("DateFormat").toString(); + date_format << settings.value("TimeFormat").toString(); +} + + // ================ // PUBLIC SLOTS // ================ @@ -905,23 +920,3 @@ void DirWidget::mouseReleaseEvent(QMouseEvent *ev){ ev->ignore(); //not handled here } } - -//==================== -// STATIC -//==================== - -QStringList DirWidget::getDateFormat() { - return DirWidget::date_format; -} - -// This function is only called if user changes sessionsettings. By doing so, operations like sorting by date -// are faster because the date format is already stored in DirWidget::date_format static variable -void DirWidget::setDateFormat() { - if(!DirWidget::date_format.isEmpty()) - DirWidget::date_format.clear(); - QSettings settings("LuminaDE","sessionsettings"); - QString date, time; - // If value doesn't exist or is not setted, empty string is returned - DirWidget::date_format << settings.value("DateFormat").toString(); - DirWidget::date_format << settings.value("TimeFormat").toString(); -} diff --git a/lumina-fm/widgets/DirWidget.h b/lumina-fm/widgets/DirWidget.h index 6f0e3d8b..adf349a9 100644 --- a/lumina-fm/widgets/DirWidget.h +++ b/lumina-fm/widgets/DirWidget.h @@ -54,8 +54,8 @@ public: void setShowCloseButton(bool show); //Date format for show items - static QStringList getDateFormat(); - static void setDateFormat(); + QStringList getDateFormat(); + void setDateFormat(); public slots: void LoadDir(QString dir, LFileInfoList list); @@ -98,7 +98,7 @@ private: //Functions for internal use void setupConnections(); QStringList currentSelection(); - static QStringList date_format; + QStringList date_format; private slots: //UI BUTTONS/Actions |