OSDN Git Service

高速化の試み
authorMasayuki Satoh <miyabi.satoh@gmail.com>
Sun, 14 Sep 2014 23:32:21 +0000 (08:32 +0900)
committerMasayuki Satoh <miyabi.satoh@gmail.com>
Sun, 14 Sep 2014 23:32:21 +0000 (08:32 +0900)
12 files changed:
foldermodel.cpp
foldermodel.h
folderpanel.cpp
folderpanel.h
folderview.cpp
mainwindow.cpp
mainwindow.h
panel.cpp
panel.h
preferences.cpp
preferences.h
thumbnailview.cpp

index 6b4cacc..43565f6 100644 (file)
@@ -29,7 +29,9 @@ FolderModel::FolderModel(QObject *parent) :
     m_history(),\r
     m_historyPos(-1),\r
     m_pixmapCache(),\r
-    m_pixmapCacheMutex()\r
+    m_pixmapCacheMutex(),\r
+    m_Palette(),\r
+    m_font()\r
 {\r
     connect(&m_fsWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(fsWatcher_directoryChanged(QString)));\r
 }\r
@@ -292,6 +294,25 @@ QModelIndex FolderModel::touch(const QString &name)
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////////\r
+/// \brief FolderModel::updateAppearance\r
+///\r
+/// 外観を変更します。\r
+///\r
+void FolderModel::updateAppearance(const Preferences &prefs)\r
+{\r
+    qDebug() << "FolderModel::updateAppearance()";\r
+\r
+    m_font = prefs.getFolderViewFont();\r
+    m_Palette.setColor(QPalette::Base, prefs.folderViewBgColor(isActive()));\r
+    m_Palette.setColor(QPalette::Text, prefs.folderViewFgColor(isActive()));\r
+    m_Palette.setColor(QPalette::Highlight, prefs.folderViewMarkedBgColor(isActive()));\r
+    m_Palette.setColor(QPalette::HighlightedText, prefs.folderViewMarkedFgColor(isActive()));\r
+    m_Palette.setColor(QPalette::Dark, prefs.folderViewHiddenColor(isActive()));\r
+    m_Palette.setColor(QPalette::Light, prefs.folderViewReadOnlyColor(isActive()));\r
+    m_Palette.setColor(QPalette::Mid, prefs.folderViewSystemColor(isActive()));\r
+}\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
 /// \brief FolderModel::activeModel\r
 /// \return アクティブなモデルを返します。\r
 ///\r
@@ -461,8 +482,6 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const
         return QVariant();\r
     }\r
 \r
-    Preferences prefs(const_cast<FolderModel*>(this));\r
-\r
     switch (role) {\r
     case Qt::DisplayRole:\r
         switch (index.column()) {\r
@@ -496,7 +515,7 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const
         break;\r
 \r
     case Qt::FontRole:\r
-        return prefs.getFolderViewFont();\r
+        return m_font;\r
 \r
     case Qt::TextAlignmentRole:\r
         switch (index.column()) {\r
@@ -508,24 +527,24 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const
 \r
     case Qt::BackgroundRole:\r
         if (isMarked(index)) {\r
-            return QBrush(prefs.folderViewMarkedBgColor(isActive()));\r
+            return marked();\r
         }\r
-        return QBrush(prefs.folderViewBgColor(isActive()));\r
+        return base();\r
 \r
     case Qt::ForegroundRole:\r
         if (isMarked(index)) {\r
-            return QBrush(prefs.folderViewMarkedFgColor(isActive()));\r
+            return markedText();\r
         }\r
         if (fileName(index) != ".." && Win32::hasSystemAttribute(filePath(index))) {\r
-            return QBrush(prefs.folderViewSystemColor(isActive()));\r
+            return system();\r
         }\r
         if (fileName(index) != ".." && fileInfo(index).isHidden()) {\r
-            return QBrush(prefs.folderViewHiddenColor(isActive()));\r
+            return hidden();\r
         }\r
         if (fileName(index) != ".." && !fileInfo(index).isWritable()) {\r
-            return QBrush(prefs.folderViewReadOnlyColor(isActive()));\r
+            return readOnly();\r
         }\r
-        return QBrush(prefs.folderViewFgColor(isActive()));\r
+        return text();\r
 \r
     case Qt::CheckStateRole:\r
         if (index.column() == Name && fileName(index) != "..") {\r
index 478b2cf..23ddf3e 100644 (file)
@@ -8,6 +8,8 @@
 #include <QBrush>\r
 #include <QFont>\r
 #include <QMutex>\r
+#include <QPalette>\r
+class Preferences;\r
 \r
 class FolderModel : public QAbstractTableModel\r
 {\r
@@ -51,6 +53,7 @@ public:
     void            setSorting(QDir::SortFlags sort);\r
     QDir::SortFlags sorting() const;\r
     QModelIndex     touch(const QString &name);\r
+    void            updateAppearance(const Preferences &prefs);\r
 \r
     static FolderModel* activeModel();\r
 \r
@@ -86,10 +89,20 @@ private:
     int                 m_historyPos;\r
     PixmapContainer     m_pixmapCache;\r
     QMutex              m_pixmapCacheMutex;\r
+    QPalette            m_Palette;\r
+    QFont               m_font;\r
 \r
     bool    isDotFile(const QModelIndex &index) const;\r
     void    setError(const QString &error = QString());\r
 \r
+    const QBrush&   base() const;\r
+    const QBrush&   text() const;\r
+    const QBrush&   marked() const;\r
+    const QBrush&   markedText() const;\r
+    const QBrush&   hidden() const;\r
+    const QBrush&   readOnly() const;\r
+    const QBrush&   system() const;\r
+\r
     // QAbstractItemModel interface\r
 public:\r
     int rowCount(const QModelIndex &parent = QModelIndex()) const;\r
@@ -211,4 +224,32 @@ inline void FolderModel::fsWatcher_directoryChanged(const QString &path)
     refresh();\r
 }\r
 \r
+inline const QBrush& FolderModel::base() const\r
+{\r
+    return m_Palette.base();\r
+}\r
+inline const QBrush& FolderModel::text() const\r
+{\r
+    return m_Palette.text();\r
+}\r
+inline const QBrush& FolderModel::marked() const\r
+{\r
+    return m_Palette.highlight();\r
+}\r
+inline const QBrush& FolderModel::markedText() const\r
+{\r
+    return m_Palette.highlightedText();\r
+}\r
+inline const QBrush& FolderModel::hidden() const\r
+{\r
+    return m_Palette.dark();\r
+}\r
+inline const QBrush& FolderModel::readOnly() const\r
+{\r
+    return m_Palette.light();\r
+}\r
+inline const QBrush& FolderModel::system() const\r
+{\r
+    return m_Palette.mid();\r
+}\r
 #endif // FOLDERMODEL_H\r
index 78c1fd1..a9a4a9e 100644 (file)
@@ -167,11 +167,10 @@ void FolderPanel::toggleView(bool checked)
 ///
 /// 外観を変更します。
 ///
-void FolderPanel::updateAppearance()
+void FolderPanel::updateAppearance(const Preferences &prefs)
 {
     qDebug() << "FolderPanel::updateAppearance()";
 
-    Preferences prefs(this);
     QPalette pal;
 
     pal = ui->locationBox->palette();
index d2ce27f..342425c 100644 (file)
@@ -5,7 +5,7 @@
 #include <QAbstractItemView>
 class FolderModel;
 class MainWindow;
-
+class Preferences;
 
 namespace Ui {
 class FolderPanel;
@@ -28,7 +28,7 @@ public:
     void                setModel(FolderModel *m);
     void                toggleSearch(bool checked);
     void                toggleView(bool checked);
-    void                updateAppearance();
+    void                updateAppearance(const Preferences &prefs);
 
 private:
     Ui::FolderPanel *ui;
index a9619fc..73d818e 100644 (file)
@@ -42,8 +42,8 @@ void FolderView::initialize(MainWindow *w)
     qDebug() << "FolderView::initialize()";
 
     connect(this, SIGNAL(doubleClicked(QModelIndex)), w, SLOT(onOpen(QModelIndex)));
-    connect(selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
-            w, SLOT(view_currentChanged(QModelIndex,QModelIndex)));
+//    connect(selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
+//            w, SLOT(view_currentChanged(QModelIndex,QModelIndex)));
 
     installEventFilter(w);
     viewport()->installEventFilter(w);
index 97ea4d5..c6b44a0 100644 (file)
@@ -42,7 +42,8 @@ MainWindow::MainWindow(QWidget *parent) :
     ui(new Ui::MainWindow),\r
     m_overwriteDialog(this),\r
     m_viewMode(ModeBasic),\r
-    m_prevMode(ModeBasic)\r
+    m_prevMode(ModeBasic),\r
+    m_actions()\r
 {\r
     ui->setupUi(this);\r
     connect(qApp, SIGNAL(focusChanged(QWidget*,QWidget*)), this, SLOT(app_focusChange(QWidget*,QWidget*)));\r
@@ -101,6 +102,11 @@ MainWindow::MainWindow(QWidget *parent) :
     if (prefs.isCheckUpdate()) {\r
         onCheckUpdate(true);\r
     }\r
+\r
+    ui->LPanel->updateAppearance(prefs);\r
+    ui->LPanel->model()->updateAppearance(prefs);\r
+    ui->RPanel->updateAppearance(prefs);\r
+    ui->RPanel->model()->updateAppearance(prefs);\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////////\r
@@ -130,6 +136,8 @@ void MainWindow::app_focusChange(QWidget *old, QWidget *now)
     if (now && (now->objectName() == "folderView" ||\r
                 now->objectName() == "thumbnailView"))\r
     {\r
+        connect(focusItemView()->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),\r
+                this, SLOT(view_currentChanged(QModelIndex,QModelIndex)));\r
         FolderModel *m = static_cast<FolderModel*>(focusItemView()->model());\r
         setActiveModel(m);\r
         ui->statusBar->showMessage(m->filePath(focusItemView()->currentIndex()));\r
@@ -1460,9 +1468,19 @@ void MainWindow::onScaleDown()
         view->scaleDown();\r
     }\r
 \r
-    ui->LPanel->updateAppearance();\r
-    ui->RPanel->updateAppearance();\r
-    ui->FPanel->updateAppearance();\r
+    Preferences prefs(this);\r
+    if (ui->LPanel->isVisible()) {\r
+        ui->LPanel->updateAppearance(prefs);\r
+        ui->LPanel->model()->updateAppearance(prefs);\r
+    }\r
+    if (ui->RPanel->isVisible()) {\r
+        ui->RPanel->updateAppearance(prefs);\r
+        ui->RPanel->model()->updateAppearance(prefs);\r
+    }\r
+    if (ui->FPanel->isVisible()) {\r
+        ui->FPanel->updateAppearance(prefs);\r
+        ui->FPanel->model()->updateAppearance(prefs);\r
+    }\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////////\r
@@ -1479,9 +1497,19 @@ void MainWindow::onScaleUp()
         view->scaleUp();\r
     }\r
 \r
-    ui->LPanel->updateAppearance();\r
-    ui->RPanel->updateAppearance();\r
-    ui->FPanel->updateAppearance();\r
+    Preferences prefs(this);\r
+    if (ui->LPanel->isVisible()) {\r
+        ui->LPanel->updateAppearance(prefs);\r
+        ui->LPanel->model()->updateAppearance(prefs);\r
+    }\r
+    if (ui->RPanel->isVisible()) {\r
+        ui->RPanel->updateAppearance(prefs);\r
+        ui->RPanel->model()->updateAppearance(prefs);\r
+    }\r
+    if (ui->FPanel->isVisible()) {\r
+        ui->FPanel->updateAppearance(prefs);\r
+        ui->FPanel->model()->updateAppearance(prefs);\r
+    }\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////////\r
@@ -1512,6 +1540,8 @@ void MainWindow::initBookmarkMenu()
                     SLOT(onOpenBookmark()));\r
         action->setData(n);\r
     }\r
+\r
+    m_actions = findChildren<QAction*>();\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////////\r
@@ -1605,9 +1635,19 @@ void MainWindow::showPreferenceDialog()
 \r
     PreferenceDialog dlg(this);\r
     if (dlg.exec() == QDialog::Accepted) {\r
-        ui->LPanel->updateAppearance();\r
-        ui->RPanel->updateAppearance();\r
-        ui->FPanel->updateAppearance();\r
+        Preferences prefs(this);\r
+        if (ui->LPanel->isVisible()) {\r
+            ui->LPanel->updateAppearance(prefs);\r
+            ui->LPanel->model()->updateAppearance(prefs);\r
+        }\r
+        if (ui->RPanel->isVisible()) {\r
+            ui->RPanel->updateAppearance(prefs);\r
+            ui->RPanel->model()->updateAppearance(prefs);\r
+        }\r
+        if (ui->FPanel->isVisible()) {\r
+            ui->FPanel->updateAppearance(prefs);\r
+            ui->FPanel->model()->updateAppearance(prefs);\r
+        }\r
     }\r
 }\r
 \r
@@ -1846,9 +1886,19 @@ void MainWindow::setActiveModel(FolderModel *m)
     connect(ui->action_MarkInvert, SIGNAL(triggered()), activeModel(), SLOT(onMarkInvert()));\r
     connect(ui->action_Refresh, SIGNAL(triggered()), activeModel(), SLOT(refresh()));\r
 \r
-    ui->LPanel->updateAppearance();\r
-    ui->RPanel->updateAppearance();\r
-    ui->FPanel->updateAppearance();\r
+    Preferences prefs(this);\r
+    if (ui->LPanel->isVisible()) {\r
+        ui->LPanel->updateAppearance(prefs);\r
+        ui->LPanel->model()->updateAppearance(prefs);\r
+    }\r
+    if (ui->RPanel->isVisible()) {\r
+        ui->RPanel->updateAppearance(prefs);\r
+        ui->RPanel->model()->updateAppearance(prefs);\r
+    }\r
+    if (ui->FPanel->isVisible()) {\r
+        ui->FPanel->updateAppearance(prefs);\r
+        ui->FPanel->model()->updateAppearance(prefs);\r
+    }\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////////\r
@@ -2179,98 +2229,6 @@ void MainWindow::updateActions()
 \r
     ui->action_historyBack->setEnabled(!activeModel()->isHistoryBegin());\r
     ui->action_HistoryForward->setEnabled(!activeModel()->isHistoryEnd());\r
-\r
-#if 0\r
-    FolderView *view;\r
-    if ((view = qobject_cast<FolderView*>(w))) {\r
-        setEnabledAllActions(true);\r
-        qDebug() << ">>>>> フォルダビューの共通メニュー設定 <<<<<";\r
-        ui->action_SearchNext->setEnabled(false);\r
-        ui->action_SearchPrev->setEnabled(false);\r
-\r
-        // 「開く」アクションを変更する\r
-        QFileInfo info(activeModel()->fileInfo(view->currentIndex()));\r
-        if (info.isDir()) {\r
-            ui->action_Open->setIcon(QIcon("://images/Open.png"));\r
-            ui->action_Open->setText(tr("開く"));\r
-            ui->action_Open->setToolTip(tr("開く"));\r
-        }\r
-        else {\r
-            ui->action_Open->setIcon(QIcon("://images/Search text.png"));\r
-            ui->action_Open->setText(tr("内蔵ビューアで開く"));\r
-            ui->action_Open->setToolTip(tr("内蔵ビューアで開く"));\r
-\r
-            QSettings settings;\r
-            if (!settings.value(IniKey_ViewerForceOpen).toBool()) {\r
-                QStringList list = settings.value(IniKey_ViewerIgnoreExt).toString().split(",");\r
-                foreach (const QString &ext, list) {\r
-                    if (ext.toLower() == info.suffix().toLower()) {\r
-                        ui->action_Open->setEnabled(false);\r
-                        break;\r
-                    }\r
-                }\r
-            }\r
-        }\r
-\r
-        if (info.fileName() == ".." && activeModel()->markedItems().isEmpty()) {\r
-            // ファイル操作を抑止\r
-            ui->action_Copy->setEnabled(false);\r
-            ui->action_Delete->setEnabled(false);\r
-            ui->action_Move->setEnabled(false);\r
-            ui->action_Rename->setEnabled(false);\r
-        }\r
-\r
-        if (m_viewMode & ModeBasic) {\r
-            qDebug() << ">>>>> 通常モードのメニュー設定 <<<<<";\r
-            ui->action_SearchNext->setEnabled(false);\r
-            ui->action_SearchPrev->setEnabled(false);\r
-\r
-            ui->action_historyBack->setEnabled(!activeModel()->isHistoryBegin());\r
-            ui->action_HistoryForward->setEnabled(!activeModel()->isHistoryEnd());\r
-\r
-            QSettings settings;\r
-            ui->action_OpenEditor->setEnabled(!settings.value(IniKey_PathEditor).toString().isEmpty());\r
-            ui->action_OpenTerminal->setEnabled(!settings.value(IniKey_PathTerminal).toString().isEmpty());\r
-\r
-        }\r
-        else if (!otherSideFolderView(view)->isVisible()) {\r
-            qDebug() << ">>>>> ハーフモードのメニュー設定 <<<<<";\r
-            ui->action_SyncPanel->setEnabled(false);\r
-            ui->action_SyncPanelTo->setEnabled(false);\r
-            ui->action_Copy->setEnabled(false);\r
-            ui->action_Move->setEnabled(false);\r
-        }\r
-    }\r
-    else if (qobject_cast<SearchBox*>(w)) {\r
-        qDebug() << ">>>>> 検索モードのメニュー設定 <<<<<";\r
-        setEnabledAllActions(false);\r
-        ui->toggle_Search->setEnabled(true);\r
-        ui->action_SearchNext->setEnabled(true);\r
-        ui->action_SearchPrev->setEnabled(true);\r
-        ui->action_About->setEnabled(true);\r
-    }\r
-    else if (qobject_cast<SimpleImageView*>(w) ||\r
-             qobject_cast<SimpleTextView*>(w))\r
-    {\r
-        qDebug() << ">>>>> ビューアモードのメニュー設定 <<<<<";\r
-        setEnabledAllActions(false);\r
-        ui->action_Quit->setEnabled(true);\r
-        ui->action_Setting->setEnabled(true);\r
-        ui->action_CheckUpdate->setEnabled(true);\r
-        ui->view_FontSizeDown->setEnabled(true);\r
-        ui->view_FontSizeUp->setEnabled(true);\r
-        ui->action_KeyDown->setEnabled(true);\r
-        ui->action_KeyEnd->setEnabled(true);\r
-        ui->action_KeyHome->setEnabled(true);\r
-        ui->action_KeyUp->setEnabled(true);\r
-        ui->action_About->setEnabled(true);\r
-        ui->key_Left->setEnabled(true);\r
-        ui->key_Right->setEnabled(true);\r
-        if (m_viewMode == ModePreview) {\r
-            ui->view_HalfMode->setEnabled(true);\r
-        }\r
-    }\r
-#endif\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////////\r
@@ -2282,7 +2240,7 @@ void MainWindow::updateActions()
 void MainWindow::setEnabledAllActions(bool enable)\r
 {\r
     qDebug() << "MainWindow::setEnabledAllActions()" << enable;\r
-    foreach (QAction *action, findChildren<QAction*>()) {\r
+    foreach (QAction *action, m_actions) {\r
         action->setEnabled(enable);\r
     }\r
 }\r
index bfef3e2..0c0612c 100644 (file)
@@ -98,6 +98,7 @@ public slots:
     void    view_statusChanged(const QString &text);\r
 \r
 private:\r
+    typedef QList<QAction*> ActionList;\r
     enum Mode {\r
         ModeBasic,      // 二画面モード\r
         ModeFull,       // 単画面モード\r
@@ -108,6 +109,7 @@ private:
     OverWriteDialog m_overwriteDialog;\r
     Mode m_viewMode;\r
     Mode m_prevMode;\r
+    ActionList m_actions;\r
 \r
     FolderModel*        activeModel() const;\r
     Panel*              activePanel() const;\r
index c39332f..f1793fb 100644 (file)
--- a/panel.cpp
+++ b/panel.cpp
@@ -132,11 +132,10 @@ void Panel::setViewItem(const QModelIndex &index)
 ///
 /// 外観を変更します。
 ///
-void Panel::updateAppearance()
+void Panel::updateAppearance(const Preferences &prefs)
 {
     qDebug() << "Panel::updateAppearance()";
 
-    Preferences prefs(this);
     QPalette pal;
 
     pal = ui->imageView->palette();
@@ -149,7 +148,7 @@ void Panel::updateAppearance()
     ui->textView->setPalette(pal);
     ui->textView->setFont(prefs.getTextViewFont());
 
-    ui->folderPanel->updateAppearance();
+    ui->folderPanel->updateAppearance(prefs);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
diff --git a/panel.h b/panel.h
index d10cb2c..2c6bb54 100644 (file)
--- a/panel.h
+++ b/panel.h
@@ -6,6 +6,7 @@
 class MainWindow;
 class FolderPanel;
 class FolderModel;
+class Preferences;
 
 namespace Ui {
 class Panel;
@@ -24,7 +25,7 @@ public:
     FolderModel*    model() const;
     void            setModel(FolderModel *m);
     void            setViewItem(const QModelIndex &index = QModelIndex());
-    void            updateAppearance();
+    void            updateAppearance(const Preferences &prefs);
     QWidget*        visibleView() const;
 
 private:
index 32fb146..5317abc 100644 (file)
@@ -150,7 +150,7 @@ QString Preferences::getBookmarkPath(int n) const
     return value(Key_BookmarkPath(n)).toString();
 }
 
-QColor Preferences::folderViewFgColor(bool active)
+QColor Preferences::folderViewFgColor(bool active) const
 {
     int darkFactor = 100;
     if (!active) {
@@ -159,7 +159,7 @@ QColor Preferences::folderViewFgColor(bool active)
     return getFolderViewFgColor().darker(darkFactor);
 }
 
-QColor Preferences::folderViewBgColor(bool active)
+QColor Preferences::folderViewBgColor(bool active) const
 {
     int darkFactor = 100;
     if (!active) {
@@ -168,7 +168,7 @@ QColor Preferences::folderViewBgColor(bool active)
     return getFolderViewBgColor().darker(darkFactor);
 }
 
-QColor Preferences::folderViewMarkedFgColor(bool active)
+QColor Preferences::folderViewMarkedFgColor(bool active) const
 {
     int darkFactor = 100;
     if (!active) {
@@ -177,7 +177,7 @@ QColor Preferences::folderViewMarkedFgColor(bool active)
     return getFolderViewMarkedFgColor().darker(darkFactor);
 }
 
-QColor Preferences::folderViewMarkedBgColor(bool active)
+QColor Preferences::folderViewMarkedBgColor(bool active) const
 {
     int darkFactor = 100;
     if (!active) {
@@ -186,7 +186,7 @@ QColor Preferences::folderViewMarkedBgColor(bool active)
     return getFolderViewMarkedBgColor().darker(darkFactor);
 }
 
-QColor Preferences::folderViewSystemColor(bool active)
+QColor Preferences::folderViewSystemColor(bool active) const
 {
     int darkFactor = 100;
     if (!active) {
@@ -195,7 +195,7 @@ QColor Preferences::folderViewSystemColor(bool active)
     return getFolderViewSystemColor().darker(darkFactor);
 }
 
-QColor Preferences::folderViewHiddenColor(bool active)
+QColor Preferences::folderViewHiddenColor(bool active) const
 {
     int darkFactor = 100;
     if (!active) {
@@ -204,7 +204,7 @@ QColor Preferences::folderViewHiddenColor(bool active)
     return getFolderViewHiddenColor().darker(darkFactor);
 }
 
-QColor Preferences::folderViewReadOnlyColor(bool active)
+QColor Preferences::folderViewReadOnlyColor(bool active) const
 {
     int darkFactor = 100;
     if (!active) {
@@ -213,7 +213,7 @@ QColor Preferences::folderViewReadOnlyColor(bool active)
     return getFolderViewReadOnlyColor().darker(darkFactor);
 }
 
-QColor Preferences::locationBoxFgColor(bool active)
+QColor Preferences::locationBoxFgColor(bool active) const
 {
     int darkFactor = 100;
     if (!active) {
@@ -222,7 +222,7 @@ QColor Preferences::locationBoxFgColor(bool active)
     return getLocationBoxFgColor().darker(darkFactor);
 }
 
-QColor Preferences::locationBoxBgColor(bool active)
+QColor Preferences::locationBoxBgColor(bool active) const
 {
     int darkFactor = 100;
     if (!active) {
index 04d3dd0..677240f 100644 (file)
@@ -38,15 +38,15 @@ public:
     QString getBookmarkEntry(int n) const;
     QString getBookmarkPath(int n) const;
 
-    QColor folderViewFgColor(bool active);
-    QColor folderViewBgColor(bool active);
-    QColor folderViewMarkedFgColor(bool active);
-    QColor folderViewMarkedBgColor(bool active);
-    QColor folderViewSystemColor(bool active);
-    QColor folderViewHiddenColor(bool active);
-    QColor folderViewReadOnlyColor(bool active);
-    QColor locationBoxFgColor(bool active);
-    QColor locationBoxBgColor(bool active);
+    QColor folderViewFgColor(bool active) const;
+    QColor folderViewBgColor(bool active) const;
+    QColor folderViewMarkedFgColor(bool active) const;
+    QColor folderViewMarkedBgColor(bool active) const;
+    QColor folderViewSystemColor(bool active) const;
+    QColor folderViewHiddenColor(bool active) const;
+    QColor folderViewReadOnlyColor(bool active) const;
+    QColor locationBoxFgColor(bool active) const;
+    QColor locationBoxBgColor(bool active) const;
 
     DECLARE_BOOL(CheckUpdate);
     DECLARE_BOOL(ConfirmQuit);
@@ -92,8 +92,6 @@ public:
     DECLARE_OBJECT(QFont, SearchBoxFont);
     DECLARE_OBJECT(QFont, TextViewFont);
 
-
-
 signals:
 
 public slots:
index 335bd4a..f4b6c67 100644 (file)
@@ -36,8 +36,8 @@ void ThumbnailView::initialize(MainWindow *w)
     qDebug() << "ThumbnailView::initialize()";
 
     connect(this, SIGNAL(doubleClicked(QModelIndex)), w, SLOT(onOpen(QModelIndex)));
-    connect(selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
-            w, SLOT(view_currentChanged(QModelIndex,QModelIndex)));
+//    connect(selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
+//            w, SLOT(view_currentChanged(QModelIndex,QModelIndex)));
 
     installEventFilter(w);
     viewport()->installEventFilter(w);