]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'Applications/16.12'
authorElvis Angelaccio <elvis.angelaccio@kde.org>
Sat, 21 Jan 2017 22:43:09 +0000 (23:43 +0100)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Sat, 21 Jan 2017 22:43:09 +0000 (23:43 +0100)
60 files changed:
CMakeLists.txt
doc/index.docbook
src/CMakeLists.txt
src/dolphincontextmenu.cpp
src/dolphindockwidget.cpp
src/dolphinmainwindow.cpp
src/dolphinpart.cpp
src/dolphinpart.desktop
src/dolphintabwidget.cpp
src/dolphintabwidget.h
src/dolphinviewcontainer.cpp
src/icons/128-system-file-manager.png [new file with mode: 0644]
src/icons/16-system-file-manager.png [new file with mode: 0644]
src/icons/22-system-file-manager.png [new file with mode: 0644]
src/icons/32-system-file-manager.png [new file with mode: 0644]
src/icons/48-system-file-manager.png [new file with mode: 0644]
src/icons/64-system-file-manager.png [new file with mode: 0644]
src/kitemviews/kfileitemlistwidget.cpp
src/kitemviews/kfileitemmodel.cpp
src/kitemviews/kfileitemmodel.h
src/kitemviews/kfileitemmodelrolesupdater.cpp
src/kitemviews/kitemlistcontainer.cpp
src/kitemviews/kitemlistcontroller.h
src/kitemviews/kitemlistwidget.cpp
src/kitemviews/private/kbaloorolesprovider.cpp
src/kitemviews/private/kfileitemmodeldirlister.h
src/kitemviews/private/kitemlistheaderwidget.h
src/kitemviews/private/kitemlistroleeditor.h
src/kitemviews/private/kitemlistselectiontoggle.h
src/kitemviews/private/kitemlistsmoothscroller.h
src/main.cpp
src/org.kde.dolphin.appdata.xml
src/panels/folders/folderspanel.cpp
src/panels/folders/treeviewcontextmenu.cpp
src/panels/information/informationpanel.cpp
src/panels/information/informationpanelcontent.cpp
src/panels/information/phononwidget.cpp
src/panels/places/placesitemmodel.cpp
src/panels/terminal/terminalpanel.cpp
src/search/dolphinsearchbox.cpp
src/search/dolphinsearchbox.h
src/settings/dolphin_generalsettings.kcfg
src/settings/kcm/kcmdolphingeneral.desktop
src/settings/kcm/kcmdolphinnavigation.desktop
src/settings/kcm/kcmdolphinservices.desktop
src/settings/kcm/kcmdolphinviewmodes.desktop
src/settings/startup/startupsettingspage.cpp
src/settings/startup/startupsettingspage.h
src/settings/viewpropertiesdialog.cpp
src/tests/kfileitemmodeltest.cpp
src/tests/kitemlistcontrollertest.cpp
src/tests/kitemlistselectionmanagertest.cpp
src/tests/kitemsettest.cpp
src/tests/viewpropertiestest.cpp
src/views/dolphinview.cpp
src/views/renamedialog.cpp
src/views/tooltips/tooltipmanager.cpp
src/views/versioncontrol/fileviewversioncontrolplugin.desktop
src/views/viewproperties.cpp
src/views/viewproperties.h

index cdf2b1b79c5b9df81f50da0761a90d08a312e8da..814c00ff22f5b9548d4feae980ddd883339b26ea 100644 (file)
@@ -3,12 +3,12 @@ cmake_minimum_required(VERSION 2.8.12)
 project(Dolphin)
 
 # KDE Application Version, managed by release script
-set (KDE_APPLICATIONS_VERSION_MAJOR "16")
-set (KDE_APPLICATIONS_VERSION_MINOR "12")
-set (KDE_APPLICATIONS_VERSION_MICRO "1")
+set (KDE_APPLICATIONS_VERSION_MAJOR "17")
+set (KDE_APPLICATIONS_VERSION_MINOR "03")
+set (KDE_APPLICATIONS_VERSION_MICRO "70")
 set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")
 
-set(QT_MIN_VERSION "5.4.0")
+set(QT_MIN_VERSION "5.5.0")
 set(KF5_MIN_VERSION "5.21.0")
 set(ECM_MIN_VERSION "1.6.0")
 
index 535f41949e405dab89c085bb49bc04fe2653aea2..44af99503fb301fd23e150a1533d85152259656d 100644 (file)
@@ -239,8 +239,8 @@ can be accessed or manipulated in different ways:
 <listitem><para>
 A file or folder can be opened by clicking it with the &LMB; (or
 double-clicking, if <guilabel>Double-click to open files and folders</guilabel>
-is enabled in the <link linkend="preferences-dialog-navigation"><quote>Navigation</quote>
-section of the settings</link>).
+is enabled in the &systemsettings; in the <menuchoice><guimenu>Input Devices</guimenu>
+<guimenuitem>Mouse</guimenuitem></menuchoice> module.
 </para></listitem>
 
 <listitem><para>
@@ -803,7 +803,10 @@ a KIOSlave is launched to provide the search results.</para>
 <para>The option from <guilabel>Everywhere</guilabel> with activated Baloo 
 services searches in all indexed folders, without Baloo this option  
 starts the search from the user's <replaceable>Home</replaceable> folder.</para>
-
+<!--FIXME 16.12
+https://git.reviewboard.kde.org/r/123883/
+Add prototype of a "More search tools..." button
+-->
 <screenshot>
 <screeninfo>Search with More Options</screeninfo>
 <mediaobject>
index 069096814d5e0ce88aac8ad405755a839c5c4d49..62d11584e662ca8be61e5fa9040f0d8a0d2c577f 100644 (file)
@@ -1,3 +1,4 @@
+include(ECMAddAppIcon)
 
 configure_file(config-baloo.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-baloo.h)
 
@@ -268,8 +269,9 @@ if(NOT WIN32)
    set(dolphin_SRCS ${dolphin_SRCS} panels/terminal/terminalpanel.cpp)
 endif()
 
-# TODO Does anything replace kde4_add_app_icon ?
-#kde4_add_app_icon(dolphin_SRCS "${KDE4_ICON_INSTALL_DIR}/oxygen/*/apps/system-file-manager.png")
+# Sets the icon on Windows and OSX
+file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*system-file-manager.png")
+ecm_add_app_icon(dolphin_SRCS ICONS ${ICONS_SRCS})
 
 kf5_add_kdeinit_executable(dolphin ${dolphin_SRCS})
 
index 666b81c8d6c17b5b16ffef2bc96fb1f3578a7428..bedb4cb80fc377bff27bc3bd3d69b4494141cb09 100644 (file)
@@ -160,7 +160,7 @@ void DolphinContextMenu::openTrashContextMenu()
         if (uiDelegate.askDeleteConfirmation(QList<QUrl>(), KIO::JobUiDelegate::EmptyTrash, KIO::JobUiDelegate::DefaultConfirmation)) {
             KIO::Job* job = KIO::emptyTrash();
             KJobWidgets::setWindow(job, m_mainWindow);
-            job->ui()->setAutoErrorHandlingEnabled(true);
+            job->uiDelegate()->setAutoErrorHandlingEnabled(true);
         }
     }
 }
index 82cf9118693d597ac0b63dfc1c37c10948dbc917..ccbecb0d666b48d3b5e310f7d4c1e93174b9d627 100644 (file)
@@ -38,13 +38,13 @@ public:
     DolphinDockTitleBar(QWidget* parent = 0) : QWidget(parent) {}
     virtual ~DolphinDockTitleBar() {}
 
-    virtual QSize minimumSizeHint() const
+    QSize minimumSizeHint() const Q_DECL_OVERRIDE
     {
         const int border = style()->pixelMetric(QStyle::PM_DockWidgetTitleBarButtonMargin);
         return QSize(border, border);
     }
 
-    virtual QSize sizeHint() const
+    QSize sizeHint() const Q_DECL_OVERRIDE
     {
         return minimumSizeHint();
     }
index e5103fd42826065233244b2581927af1e802d392..1dcae7ec4955d096d6baafce4437f3c1aa3e13b4 100644 (file)
@@ -723,7 +723,7 @@ void DolphinMainWindow::handleUrl(const QUrl& url)
     } else if (KProtocolManager::supportsListing(url)) {
         // stat the URL to see if it is a dir or not
         m_lastHandleUrlStatJob = KIO::stat(url, KIO::HideProgressInfo);
-        if (m_lastHandleUrlStatJob->ui()) {
+        if (m_lastHandleUrlStatJob->uiDelegate()) {
             KJobWidgets::setWindow(m_lastHandleUrlStatJob, this);
         }
         connect(m_lastHandleUrlStatJob, &KIO::Job::result,
@@ -961,13 +961,17 @@ void DolphinMainWindow::setUrlAsCaption(const QUrl& url)
         }
     }
 
-    QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName();
-    if (fileName.isEmpty()) {
-        fileName = '/';
+    if (GeneralSettings::showFullPathInTitlebar()) {
+        const QString path = url.adjusted(QUrl::StripTrailingSlash).path();
+        caption.append(path);
+    } else {
+        QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName();
+        if (fileName.isEmpty()) {
+            fileName = '/';
+        }
+        caption.append(fileName);
     }
 
-    caption.append(fileName);
-
     setWindowTitle(caption);
 }
 
@@ -1404,6 +1408,7 @@ void DolphinMainWindow::refreshViews()
         const bool splitView = GeneralSettings::splitView();
         m_tabWidget->currentTabPage()->setSplitViewEnabled(splitView);
         updateSplitAction();
+        setUrlAsCaption(activeViewContainer()->url());
     }
 
     emit settingsChanged();
index aa9ab2986279d1407df0e082c3e88a2f8a27ad16..b55bcabb25e9eeb1315eabf5dbe314f4f26397ff 100644 (file)
@@ -78,6 +78,7 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL
             this, &DolphinPart::slotErrorMessage);
 
     connect(m_view, &DolphinView::directoryLoadingCompleted, this, static_cast<void(DolphinPart::*)()>(&DolphinPart::completed));
+    connect(m_view, &DolphinView::directoryLoadingCompleted, this, &DolphinPart::updatePasteAction);
     connect(m_view, &DolphinView::directoryLoadingProgress, this, &DolphinPart::updateProgress);
     connect(m_view, &DolphinView::errorMessage, this, &DolphinPart::slotErrorMessage);
 
index 6b9398da88a6350e6474d0b5b207ce85a4d3d3f6..da0a659d3d27ca9a9cce0d1802f8331e6edf1892 100644 (file)
@@ -2,7 +2,6 @@
 Type=Service
 Name=Dolphin View
 Name[ar]=منظور دولفين
-Name[ast]=Vista de Dolphin
 Name[ca]=Vista del Dolphin
 Name[ca@valencia]=Vista del Dolphin
 Name[cs]=Pohled Dolphin
@@ -107,7 +106,6 @@ Exec=dolphin
 [Desktop Action compact]
 Name=Compact
 Name[ar]=متراصّ
-Name[ast]=Compautu
 Name[ca]=Compacta
 Name[ca@valencia]=Compacta
 Name[cs]=Kompaktní
index 22674d1bd042bfc1280963f5be70289f111a917f..bcd4a49fdfea89df84cedf27131b875d54f5291b 100644 (file)
@@ -32,7 +32,8 @@
 
 DolphinTabWidget::DolphinTabWidget(QWidget* parent) :
     QTabWidget(parent),
-    m_placesSelectorVisible(true)
+    m_placesSelectorVisible(true),
+    m_previousTab(-1)
 {
     connect(this, &DolphinTabWidget::tabCloseRequested,
             this, static_cast<void (DolphinTabWidget::*)(int)>(&DolphinTabWidget::closeTab));
@@ -304,9 +305,15 @@ void DolphinTabWidget::tabUrlChanged(const QUrl& url)
 void DolphinTabWidget::currentTabChanged(int index)
 {
     DolphinViewContainer* viewContainer = tabPageAt(index)->activeViewContainer();
+    viewContainer->setActive(true);
     emit activeViewChanged(viewContainer);
     emit currentUrlChanged(viewContainer->url());
     viewContainer->view()->setFocus();
+
+    if (tabPageAt(m_previousTab)) {
+        tabPageAt(m_previousTab)->activeViewContainer()->setActive(false);
+    }
+    m_previousTab = index;
 }
 
 void DolphinTabWidget::tabInserted(int index)
index 7b3a18814c59ad8adad380d069ea9595884225c8..50ebd602ab85342d405cf8540b0dbd0d701a6e9b 100644 (file)
@@ -186,6 +186,8 @@ private:
 private:
     /** Caches the (negated) places panel visibility */
     bool m_placesSelectorVisible;
+
+    int m_previousTab;
 };
 
 #endif
index 4e625c7d8ee4ddd69e2f9b41c1e1fe0ee7483627..2ea5b7e00e4e28e19d2bf70f377fb1cefd46c568 100644 (file)
@@ -361,6 +361,9 @@ QString DolphinViewContainer::placesText() const
         if (text.isEmpty()) {
             text = url().host();
         }
+        if (text.isEmpty()) {
+            text = url().scheme();
+        }
     }
 
     return text;
diff --git a/src/icons/128-system-file-manager.png b/src/icons/128-system-file-manager.png
new file mode 100644 (file)
index 0000000..a199a71
Binary files /dev/null and b/src/icons/128-system-file-manager.png differ
diff --git a/src/icons/16-system-file-manager.png b/src/icons/16-system-file-manager.png
new file mode 100644 (file)
index 0000000..2771c85
Binary files /dev/null and b/src/icons/16-system-file-manager.png differ
diff --git a/src/icons/22-system-file-manager.png b/src/icons/22-system-file-manager.png
new file mode 100644 (file)
index 0000000..ac0c54a
Binary files /dev/null and b/src/icons/22-system-file-manager.png differ
diff --git a/src/icons/32-system-file-manager.png b/src/icons/32-system-file-manager.png
new file mode 100644 (file)
index 0000000..c095d42
Binary files /dev/null and b/src/icons/32-system-file-manager.png differ
diff --git a/src/icons/48-system-file-manager.png b/src/icons/48-system-file-manager.png
new file mode 100644 (file)
index 0000000..a742a73
Binary files /dev/null and b/src/icons/48-system-file-manager.png differ
diff --git a/src/icons/64-system-file-manager.png b/src/icons/64-system-file-manager.png
new file mode 100644 (file)
index 0000000..9a7ebde
Binary files /dev/null and b/src/icons/64-system-file-manager.png differ
index 7e5b4bb132c6feb4e26c87688cce91a542f9de4a..e0548ab2a5072c899fb0295b139079e4bfd8d309 100644 (file)
@@ -80,7 +80,7 @@ QString KFileItemListWidgetInformant::roleText(const QByteArray& role,
             const KIO::filesize_t size = roleValue.value<KIO::filesize_t>();
             text = KFormat().formatByteSize(size);
         }
-    } else if (role == "date") {
+    } else if (role == "modificationtime" || role == "accesstime") {
         const QDateTime dateTime = roleValue.toDateTime();
         text = QLocale().toString(dateTime, QLocale::ShortFormat);
     } else {
index 05f85a633d7be1f7973319eda9f55ef66686de6f..7e14baff0b79e97535740b7ace3ac6fde7f127ef 100644 (file)
@@ -80,6 +80,7 @@ KFileItemModel::KFileItemModel(QObject* parent) :
     connect(m_dirLister, static_cast<void(KFileItemModelDirLister::*)()>(&KFileItemModelDirLister::clear), this, &KFileItemModel::slotClear);
     connect(m_dirLister, &KFileItemModelDirLister::infoMessage, this, &KFileItemModel::infoMessage);
     connect(m_dirLister, &KFileItemModelDirLister::errorMessage, this, &KFileItemModel::errorMessage);
+    connect(m_dirLister, &KFileItemModelDirLister::percent, this, &KFileItemModel::directoryLoadingProgress);
     connect(m_dirLister, static_cast<void(KFileItemModelDirLister::*)(const QUrl&, const QUrl&)>(&KFileItemModelDirLister::redirection), this, &KFileItemModel::directoryRedirection);
     connect(m_dirLister, &KFileItemModelDirLister::urlIsFileError, this, &KFileItemModel::urlIsFileError);
 
@@ -327,7 +328,8 @@ QList<QPair<int, QVariant> > KFileItemModel::groups() const
         switch (typeForRole(sortRole())) {
         case NameRole:        m_groups = nameRoleGroups(); break;
         case SizeRole:        m_groups = sizeRoleGroups(); break;
-        case DateRole:        m_groups = dateRoleGroups(); break;
+        case ModificationTimeRole:        m_groups = timeRoleGroups(KFileItem::ModificationTime); break;
+        case AccessTimeRole:        m_groups = timeRoleGroups(KFileItem::AccessTime); break;
         case PermissionsRole: m_groups = permissionRoleGroups(); break;
         case RatingRole:      m_groups = ratingRoleGroups(); break;
         default:              m_groups = genericStringRoleGroups(sortRole()); break;
@@ -416,12 +418,15 @@ int KFileItemModel::index(const QUrl& url) const
             foreach (const QUrl& url, indexesForUrl.uniqueKeys()) {
                 if (indexesForUrl.count(url) > 1) {
                     qCWarning(DolphinDebug) << "Multiple items found with the URL" << url;
-                    foreach (int index, indexesForUrl.values(url)) {
-                        const ItemData* data = m_itemData.at(index);
-                        qCWarning(DolphinDebug) << "index" << index << ":" << data->item;
+
+                    auto it = indexesForUrl.find(url);
+                    while (it != indexesForUrl.end() && it.key() == url) {
+                        const ItemData* data = m_itemData.at(it.value());
+                        qCWarning(DolphinDebug) << "index" << it.value() << ":" << data->item;
                         if (data->parent) {
                             qCWarning(DolphinDebug) << "parent" << data->parent->item;
                         }
+                        ++it;
                     }
                 }
             }
@@ -590,7 +595,12 @@ int KFileItemModel::expandedParentsCount(int index) const
 
 QSet<QUrl> KFileItemModel::expandedDirectories() const
 {
-    return m_expandedDirs.values().toSet();
+    QSet<QUrl> result;
+    const auto dirs = m_expandedDirs;
+    for (const auto &dir : dirs) {
+        result.insert(dir);
+    }
+    return result;
 }
 
 void KFileItemModel::restoreExpandedDirectories(const QSet<QUrl> &urls)
@@ -1523,12 +1533,20 @@ QHash<QByteArray, QVariant> KFileItemModel::retrieveData(const KFileItem& item,
         data.insert(sharedValue("size"), item.size());
     }
 
-    if (m_requestRole[DateRole]) {
+    if (m_requestRole[ModificationTimeRole]) {
         // Don't use KFileItem::timeString() as this is too expensive when
         // having several thousands of items. Instead the formatting of the
         // date-time will be done on-demand by the view when the date will be shown.
         const QDateTime dateTime = item.time(KFileItem::ModificationTime);
-        data.insert(sharedValue("date"), dateTime);
+        data.insert(sharedValue("modificationtime"), dateTime);
+    }
+
+    if (m_requestRole[AccessTimeRole]) {
+        // Don't use KFileItem::timeString() as this is too expensive when
+        // having several thousands of items. Instead the formatting of the
+        // date-time will be done on-demand by the view when the date will be shown.
+        const QDateTime dateTime = item.time(KFileItem::AccessTime);
+        data.insert(sharedValue("accesstime"), dateTime);
     }
 
     if (m_requestRole[PermissionsRole]) {
@@ -1753,7 +1771,7 @@ int KFileItemModel::sortRoleCompare(const ItemData* a, const ItemData* b, const
         break;
     }
 
-    case DateRole: {
+    case ModificationTimeRole: {
         const QDateTime dateTimeA = itemA.time(KFileItem::ModificationTime);
         const QDateTime dateTimeB = itemB.time(KFileItem::ModificationTime);
         if (dateTimeA < dateTimeB) {
@@ -1933,7 +1951,7 @@ QList<QPair<int, QVariant> > KFileItemModel::sizeRoleGroups() const
     return groups;
 }
 
-QList<QPair<int, QVariant> > KFileItemModel::dateRoleGroups() const
+QList<QPair<int, QVariant> > KFileItemModel::timeRoleGroups(KFileItem::FileTimes which) const
 {
     Q_ASSERT(!m_itemData.isEmpty());
 
@@ -1942,26 +1960,26 @@ QList<QPair<int, QVariant> > KFileItemModel::dateRoleGroups() const
 
     const QDate currentDate = QDate::currentDate();
 
-    QDate previousModifiedDate;
+    QDate previousFileDate;
     QString groupValue;
     for (int i = 0; i <= maxIndex; ++i) {
         if (isChildItem(i)) {
             continue;
         }
 
-        const QDateTime modifiedTime = m_itemData.at(i)->item.time(KFileItem::ModificationTime);
-        const QDate modifiedDate = modifiedTime.date();
-        if (modifiedDate == previousModifiedDate) {
+        const QDateTime fileTime = m_itemData.at(i)->item.time(which);
+        const QDate fileDate = fileTime.date();
+        if (fileDate == previousFileDate) {
             // The current item is in the same group as the previous item
             continue;
         }
-        previousModifiedDate = modifiedDate;
+        previousFileDate = fileDate;
 
-        const int daysDistance = modifiedDate.daysTo(currentDate);
+        const int daysDistance = fileDate.daysTo(currentDate);
 
         QString newGroupValue;
-        if (currentDate.year() == modifiedDate.year() &&
-            currentDate.month() == modifiedDate.month()) {
+        if (currentDate.year() == fileDate.year() &&
+            currentDate.month() == fileDate.month()) {
 
             switch (daysDistance / 7) {
             case 0:
@@ -1969,7 +1987,7 @@ QList<QPair<int, QVariant> > KFileItemModel::dateRoleGroups() const
                 case 0:  newGroupValue = i18nc("@title:group Date", "Today"); break;
                 case 1:  newGroupValue = i18nc("@title:group Date", "Yesterday"); break;
                 default:
-                    newGroupValue = modifiedTime.toString(
+                    newGroupValue = fileTime.toString(
                         i18nc("@title:group Date: The week day name: dddd", "dddd"));
                     newGroupValue = i18nc("Can be used to script translation of \"dddd\""
                         "with context @title:group Date", "%1", newGroupValue);
@@ -1993,18 +2011,18 @@ QList<QPair<int, QVariant> > KFileItemModel::dateRoleGroups() const
             }
         } else {
             const QDate lastMonthDate = currentDate.addMonths(-1);
-            if  (lastMonthDate.year() == modifiedDate.year() &&
-                 lastMonthDate.month() == modifiedDate.month()) {
+            if  (lastMonthDate.year() == fileDate.year() &&
+                 lastMonthDate.month() == fileDate.month()) {
 
                 if (daysDistance == 1) {
-                    newGroupValue = modifiedTime.toString(i18nc("@title:group Date: "
+                    newGroupValue = fileTime.toString(i18nc("@title:group Date: "
                         "MMMM is full month name in current locale, and yyyy is "
                         "full year number", "'Yesterday' (MMMM, yyyy)"));
                     newGroupValue = i18nc("Can be used to script translation of "
                         "\"'Yesterday' (MMMM, yyyy)\" with context @title:group Date",
                         "%1", newGroupValue);
                 } else if (daysDistance <= 7) {
-                    newGroupValue = modifiedTime.toString(i18nc("@title:group Date: "
+                    newGroupValue = fileTime.toString(i18nc("@title:group Date: "
                         "The week day name: dddd, MMMM is full month name "
                         "in current locale, and yyyy is full year number",
                         "dddd (MMMM, yyyy)"));
@@ -2012,28 +2030,28 @@ QList<QPair<int, QVariant> > KFileItemModel::dateRoleGroups() const
                         "\"dddd (MMMM, yyyy)\" with context @title:group Date",
                         "%1", newGroupValue);
                 } else if (daysDistance <= 7 * 2) {
-                    newGroupValue = modifiedTime.toString(i18nc("@title:group Date: "
+                    newGroupValue = fileTime.toString(i18nc("@title:group Date: "
                         "MMMM is full month name in current locale, and yyyy is "
                         "full year number", "'One Week Ago' (MMMM, yyyy)"));
                     newGroupValue = i18nc("Can be used to script translation of "
                         "\"'One Week Ago' (MMMM, yyyy)\" with context @title:group Date",
                         "%1", newGroupValue);
                 } else if (daysDistance <= 7 * 3) {
-                    newGroupValue = modifiedTime.toString(i18nc("@title:group Date: "
+                    newGroupValue = fileTime.toString(i18nc("@title:group Date: "
                         "MMMM is full month name in current locale, and yyyy is "
                         "full year number", "'Two Weeks Ago' (MMMM, yyyy)"));
                     newGroupValue = i18nc("Can be used to script translation of "
                         "\"'Two Weeks Ago' (MMMM, yyyy)\" with context @title:group Date",
                         "%1", newGroupValue);
                 } else if (daysDistance <= 7 * 4) {
-                    newGroupValue = modifiedTime.toString(i18nc("@title:group Date: "
+                    newGroupValue = fileTime.toString(i18nc("@title:group Date: "
                         "MMMM is full month name in current locale, and yyyy is "
                         "full year number", "'Three Weeks Ago' (MMMM, yyyy)"));
                     newGroupValue = i18nc("Can be used to script translation of "
                         "\"'Three Weeks Ago' (MMMM, yyyy)\" with context @title:group Date",
                         "%1", newGroupValue);
                 } else {
-                    newGroupValue = modifiedTime.toString(i18nc("@title:group Date: "
+                    newGroupValue = fileTime.toString(i18nc("@title:group Date: "
                         "MMMM is full month name in current locale, and yyyy is "
                         "full year number", "'Earlier on' MMMM, yyyy"));
                     newGroupValue = i18nc("Can be used to script translation of "
@@ -2041,7 +2059,7 @@ QList<QPair<int, QVariant> > KFileItemModel::dateRoleGroups() const
                         "%1", newGroupValue);
                 }
             } else {
-                newGroupValue = modifiedTime.toString(i18nc("@title:group "
+                newGroupValue = fileTime.toString(i18nc("@title:group "
                     "The month and year: MMMM is full month name in current locale, "
                     "and yyyy is full year number", "MMMM, yyyy"));
                 newGroupValue = i18nc("Can be used to script translation of "
@@ -2212,11 +2230,13 @@ const KFileItemModel::RoleInfoMap* KFileItemModel::rolesInfoMap(int& count)
         { 0,             NoRole,          0, 0,                                             0, 0,                                     false, false },
         { "text",        NameRole,        I18N_NOOP2_NOSTRIP("@label", "Name"),             0, 0,                                     false, false },
         { "size",        SizeRole,        I18N_NOOP2_NOSTRIP("@label", "Size"),             0, 0,                                     false, false },
-        { "date",        DateRole,        I18N_NOOP2_NOSTRIP("@label", "Date"),             0, 0,                                     false, false },
+        { "modificationtime",        ModificationTimeRole,        I18N_NOOP2_NOSTRIP("@label", "Modified"),             0, 0,                                     false, false },
+        { "accesstime",        AccessTimeRole,        I18N_NOOP2_NOSTRIP("@label", "Accessed"),             0, 0,                                     false, false },
         { "type",        TypeRole,        I18N_NOOP2_NOSTRIP("@label", "Type"),             0, 0,                                     false, false },
         { "rating",      RatingRole,      I18N_NOOP2_NOSTRIP("@label", "Rating"),           0, 0,                                     true,  false },
         { "tags",        TagsRole,        I18N_NOOP2_NOSTRIP("@label", "Tags"),             0, 0,                                     true,  false },
         { "comment",     CommentRole,     I18N_NOOP2_NOSTRIP("@label", "Comment"),          0, 0,                                     true,  false },
+        { "title",       TitleRole,       I18N_NOOP2_NOSTRIP("@label", "Title"),            I18N_NOOP2_NOSTRIP("@label", "Document"), true,  true  },
         { "wordCount",   WordCountRole,   I18N_NOOP2_NOSTRIP("@label", "Word Count"),       I18N_NOOP2_NOSTRIP("@label", "Document"), true,  true  },
         { "lineCount",   LineCountRole,   I18N_NOOP2_NOSTRIP("@label", "Line Count"),       I18N_NOOP2_NOSTRIP("@label", "Document"), true,  true  },
         { "imageSize",   ImageSizeRole,   I18N_NOOP2_NOSTRIP("@label", "Image Size"),       I18N_NOOP2_NOSTRIP("@label", "Image"),    true,  true  },
index 8a0df72b921cf933278ef7b7cd0a923080b08777..dc5746a8916f1048809c477c50ac5ef3d84e5171 100644 (file)
@@ -280,11 +280,11 @@ private slots:
 private:
     enum RoleType {
         // User visible roles:
-        NoRole, NameRole, SizeRole, DateRole, PermissionsRole, OwnerRole,
+        NoRole, NameRole, SizeRole, ModificationTimeRole, AccessTimeRole, PermissionsRole, OwnerRole,
         GroupRole, TypeRole, DestinationRole, PathRole,
         // User visible roles available with Baloo:
         CommentRole, TagsRole, RatingRole, ImageSizeRole, OrientationRole,
-        WordCountRole, LineCountRole, ArtistRole, AlbumRole, DurationRole, TrackRole,
+        WordCountRole, TitleRole, LineCountRole, ArtistRole, AlbumRole, DurationRole, TrackRole,
         OriginUrlRole,
         // Non-visible roles:
         IsDirRole, IsLinkRole, IsExpandedRole, IsExpandableRole, ExpandedParentsCountRole,
@@ -383,7 +383,7 @@ private:
 
     QList<QPair<int, QVariant> > nameRoleGroups() const;
     QList<QPair<int, QVariant> > sizeRoleGroups() const;
-    QList<QPair<int, QVariant> > dateRoleGroups() const;
+    QList<QPair<int, QVariant> > timeRoleGroups(KFileItem::FileTimes which) const;
     QList<QPair<int, QVariant> > permissionRoleGroups() const;
     QList<QPair<int, QVariant> > ratingRoleGroups() const;
     QList<QPair<int, QVariant> > genericStringRoleGroups(const QByteArray& typeForRole) const;
index 92a0200039404ce84c943a8a20bf874709ac4e86..6e1c3d3ddd08a62d423665b2db6b2d1a446348f7 100644 (file)
@@ -907,7 +907,7 @@ void KFileItemModelRolesUpdater::startPreviewJob()
     KIO::PreviewJob* job = new KIO::PreviewJob(itemSubSet, cacheSize, &m_enabledPlugins);
 
     job->setIgnoreMaximumSize(itemSubSet.first().isLocalFile());
-    if (job->ui()) {
+    if (job->uiDelegate()) {
         KJobWidgets::setWindow(job, qApp->activeWindow());
     }
 
index 6a0c5756c03fe9b23012717c3cdc9f40a355f53f..b4ea62fac354249d66e4977d94807c6d05f515a0 100644 (file)
@@ -48,7 +48,7 @@ class KItemListContainerViewport : public QGraphicsView
 public:
     KItemListContainerViewport(QGraphicsScene* scene, QWidget* parent);
 protected:
-    virtual void wheelEvent(QWheelEvent* event);
+    void wheelEvent(QWheelEvent* event) Q_DECL_OVERRIDE;
 };
 
 KItemListContainerViewport::KItemListContainerViewport(QGraphicsScene* scene, QWidget* parent) :
index b8a93edacbaeaccf382971dc17d299bcda8c6dc8..5e5e6b7c3eedc2a142552bd4c44ac635811a3b21 100644 (file)
@@ -59,7 +59,6 @@ class QTransform;
 class DOLPHIN_EXPORT KItemListController : public QObject
 {
     Q_OBJECT
-    Q_ENUMS(SelectionBehavior)
     Q_PROPERTY(KItemModelBase* model READ model WRITE setModel)
     Q_PROPERTY(KItemListView *view READ view WRITE setView)
     Q_PROPERTY(SelectionBehavior selectionBehavior READ selectionBehavior WRITE setSelectionBehavior)
@@ -72,6 +71,7 @@ public:
         SingleSelection,
         MultiSelection
     };
+    Q_ENUM(SelectionBehavior)
 
     enum AutoActivationBehavior {
         ActivationAndExpansion,
index 9c31155b3e35ce88723d4a63b0132870fd0f1b1a..65fc911bd9b60f3ddd9628327da1ca423407e339 100644 (file)
@@ -179,8 +179,8 @@ QList<QByteArray> KItemListWidget::visibleRoles() const
 
 void KItemListWidget::setColumnWidth(const QByteArray& role, qreal width)
 {
-    if (m_columnWidths.value(role) != width) {
-        const qreal previousWidth = width;
+    const qreal previousWidth = m_columnWidths.value(role);
+    if (previousWidth != width) {
         m_columnWidths.insert(role, width);
         columnWidthChanged(role, width, previousWidth);
         update();
index 2ce1f7bf64a99d12a847e2b4f0ae68b2488c3014..16e3935ca9477134045d0fb1ee7031d0108025cd 100644 (file)
@@ -138,6 +138,7 @@ KBalooRolesProvider::KBalooRolesProvider() :
         { "rating", "rating" },
         { "tag",        "tags" },
         { "comment",   "comment" },
+        { "title",         "title" },
         { "wordCount",     "wordCount" },
         { "lineCount",     "lineCount" },
         { "width",         "imageSize" },
index c2c621aed1c24ac19921eea851c280f5209b67ae..5aa2b63031cc7ae12d78a74725097ad5674ec87b 100644 (file)
@@ -48,7 +48,7 @@ signals:
     void urlIsFileError(const QUrl& url);
 
 protected:
-    virtual void handleError(KIO::Job* job);
+    void handleError(KIO::Job* job) Q_DECL_OVERRIDE;
 };
 
 #endif
index 2a80c205dd1fa52c082943f6b787b71a268c178d..2342b4907fcc4f08c354dfe82f4a3ae9ef9ae8a5 100644 (file)
@@ -64,7 +64,7 @@ public:
 
     qreal minimumColumnWidth() const;
 
-    virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
+    void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0) Q_DECL_OVERRIDE;
 
 signals:
     /**
@@ -104,13 +104,13 @@ signals:
     void sortRoleChanged(const QByteArray& current, const QByteArray& previous);
 
 protected:
-    virtual void mousePressEvent(QGraphicsSceneMouseEvent* event);
-    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
-    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
-    virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event);
-    virtual void hoverEnterEvent(QGraphicsSceneHoverEvent* event);
-    virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent* event);
-    virtual void hoverMoveEvent(QGraphicsSceneHoverEvent* event);
+    void mousePressEvent(QGraphicsSceneMouseEvent* event) Q_DECL_OVERRIDE;
+    void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) Q_DECL_OVERRIDE;
+    void mouseMoveEvent(QGraphicsSceneMouseEvent* event) Q_DECL_OVERRIDE;
+    void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) Q_DECL_OVERRIDE;
+    void hoverEnterEvent(QGraphicsSceneHoverEvent* event) Q_DECL_OVERRIDE;
+    void hoverLeaveEvent(QGraphicsSceneHoverEvent* event) Q_DECL_OVERRIDE;
+    void hoverMoveEvent(QGraphicsSceneHoverEvent* event) Q_DECL_OVERRIDE;
 
 private slots:
     void slotSortRoleChanged(const QByteArray& current, const QByteArray& previous);
index 3b8f96865838e33ef0945816c62fa20ced70c76c..f889ea4f4ff601275636be1f0a658d02166eaf22 100644 (file)
@@ -44,15 +44,15 @@ public:
     void setRole(const QByteArray& role);
     QByteArray role() const;
 
-    virtual bool eventFilter(QObject* watched, QEvent* event);
+    bool eventFilter(QObject* watched, QEvent* event) Q_DECL_OVERRIDE;
 
 signals:
     void roleEditingFinished(const QByteArray& role, const QVariant& value);
     void roleEditingCanceled(const QByteArray& role, const QVariant& value);
 
 protected:
-    virtual bool event(QEvent* event);
-    virtual void keyPressEvent(QKeyEvent* event);
+    bool event(QEvent* event) Q_DECL_OVERRIDE;
+    void keyPressEvent(QKeyEvent* event) Q_DECL_OVERRIDE;
 
 private slots:
     /**
index d058ee988d5db97e7aa9e982a75ab7c4e3309b19..e3f5bb63c87a06fd6e5bca20a3605885570d5e5b 100644 (file)
@@ -42,10 +42,10 @@ public:
 
     void setHovered(bool hovered);
 
-    virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
+    void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0) Q_DECL_OVERRIDE;
 
 protected:
-    virtual void resizeEvent(QGraphicsSceneResizeEvent* event);
+    void resizeEvent(QGraphicsSceneResizeEvent* event) Q_DECL_OVERRIDE;
 
 private:
     void updatePixmap();
index a3576a3fdddbc0874c6ff65ba6ff1557e48a0b21..7d01a6b62ce269253cb4df0b2e61375c78c8950a 100644 (file)
@@ -83,7 +83,7 @@ public:
     void handleWheelEvent(QWheelEvent* event);
 
 protected:
-    virtual bool eventFilter(QObject* obj, QEvent* event);
+    bool eventFilter(QObject* obj, QEvent* event) Q_DECL_OVERRIDE;
 
 private slots:
     void slotAnimationStateChanged(QAbstractAnimation::State newState,
index 8987d351f058d5b02a67c982ca51c937edc89ecf..acba8daeddb1c1d9704c24affd416752e06b390f 100644 (file)
@@ -39,7 +39,7 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
 {
     QApplication app(argc, argv);
     app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
-    app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager")));
+    app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon()));
 
     KCrash::initialize();
 
index d0cec503072e175afd2256e15bffdc20dbf6418f..233819559f7098a220a2965ff78ee816f0bd1ade 100644 (file)
@@ -93,7 +93,7 @@
   <description>
     <p>Dolphin is a lightweight file manager. It has been designed with ease of use and simplicity in mind, while still allowing flexibility and customisation. This means that you can do your file management exactly the way you want to do it.</p>
     <p xml:lang="ar">دولفين هو مدير ملفات خفيف. صُمِّم دولفين مع أخذ سهولة الاستخدام والبساطة بعين الاعتبار، مع السماح بالمرونة والتخصيص. يعني هذا أنه يمكنك إدارة ملفاتك كما تريد تمامًا.</p>
-    <p xml:lang="ast">Dolphin ye un xestor de ficheros llixeru. Diseñóse cola facilidá d'usu y cenciellez na miente entrín entá permite la flexibilidá y personalización. Esto quier dicir que pues facer la to xestión de ficheros exautamente como tu quies facela.</p>
+    <p xml:lang="ast">Dolphin ye un xestor de ficheros llixeru. Diseñóse cola facilidá y cenciellez d'usu en mente, el mesmu tiempu qu'entá permite la flixibilidá y personalización. Quier dicir que pues facer la to xestión de ficheros exautamente como quieras facelo.</p>
     <p xml:lang="bs">Dolphinje lagan file manager. On je bio dizajniran sa lakoćom korišćenja i jednostavnosti u vidu, još omogućavajući fleksibilnost i prilagođavanje. To znači da možete da radite svoje upravljanje datotekama onako kako želite da to uradi.</p>
     <p xml:lang="ca">El Dolphin és un gestor de fitxers lleuger. S'ha dissenyat pensant a facilitar el seu ús i que sigui simple, permetent la flexibilitat i la personalització. Això vol dir que podeu fer la gestió dels vostres fitxers de la manera exacta com ho vulgueu fer.</p>
     <p xml:lang="ca-valencia">El Dolphin és un gestor de fitxers lleuger. S'ha dissenyat pensant a facilitar el seu ús i que siga simple, permetent la flexibilitat i la personalització. Això vol dir que podeu fer la gestió dels vostres fitxers de la manera exacta com ho vulgueu fer.</p>
     <p xml:lang="zh-TW">Dolphin 是一套輕量級的檔案管理員。它設計的理念是易用與簡單,但仍然保持足夠的彈性。這表示您可以用您想要使用的方式來管理您的檔案。</p>
     <p>Features:</p>
     <p xml:lang="ar">المزايا:</p>
-    <p xml:lang="ast">Carauterístiques</p>
+    <p xml:lang="ast">Carauterístiques:</p>
     <p xml:lang="bs">Svojstva:</p>
     <p xml:lang="ca">Característiques:</p>
     <p xml:lang="ca-valencia">Característiques:</p>
     <p xml:lang="zh-TW">功能:</p>
     <ul>
       <li>Navigation (or breadcrumb) bar for URLs, allowing you to quickly navigate through the hierarchy of files and folders.</li>
-      <li xml:lang="ast">Barra de navegación </li>
       <li xml:lang="bs">Navigacijska (ili mrvična) traka za URL, dopušta vam da se brzo krećete kroz hijerarhiju datoteka i direktorija.</li>
       <li xml:lang="ca">Barra de navegació (o fil d'Ariadna) pels URL, permetent una navegació ràpida per la jerarquia dels fitxers i carpetes.</li>
       <li xml:lang="ca-valencia">Barra de navegació (o fil d'Ariadna) pels URL, permetent una navegació ràpida per la jerarquia dels fitxers i carpetes.</li>
       <li xml:lang="zh-TW">網址導覽列讓您可以快速瀏覽檔案與資料夾。</li>
       <li>Supports several different kinds of view styles and properties and allows you to configure the view exactly how you want it.</li>
       <li xml:lang="ar">يدعم العديد من الأنواع المختلفة من الخصائص وأنماط العرض ويسمح لك بضبط العرض كما تريد تمامًا.</li>
-      <li xml:lang="ast">Sofitalla delles tribes de vista y propiedaes diferentes y permítete configurar la vista exautamente como tu quies.</li>
       <li xml:lang="bs">Dopušta vište vrsta stilova pogleda i svojstava i dopšta vam da konfigurišete pogled baš kako želite.</li>
       <li xml:lang="ca">Accepta diferents classes diverses d'estils de visualització i propietats i us permet configurar la visualització exactament com la vulgueu.</li>
       <li xml:lang="ca-valencia">Accepta diferents classes diverses d'estils de visualització i propietats i vos permet configurar la visualització exactament com la vulgueu.</li>
       <li xml:lang="zh-TW">網址導覽列讓您可以快速瀏覽檔案與資料夾。</li>
       <li>Split view, allowing you to easily copy or move files between locations.</li>
       <li xml:lang="ar">العرض المقسوم، يسمح لك بنسخ ونقل الملفات بين مكانين بسهولة.</li>
-      <li xml:lang="ast">Vista dixebrada, permítete copiar y mover ficheros d'un mou cenciellu ente allugamientos.</li>
       <li xml:lang="bs">Razdvaja pogled, dopuštajući lako kopiranje ili pomijeranje datoteka između lokacija</li>
       <li xml:lang="ca">Divisió de visualització, permetent copiar o moure fitxers fàcilment entre les ubicacions.</li>
       <li xml:lang="ca-valencia">Divisió de visualització, permetent copiar o moure fitxers fàcilment entre les ubicacions.</li>
       <li xml:lang="zh-TW">支援數個檢視模式,您也可以調整檢視模式的屬性。</li>
       <li>Additional information and shortcuts are available as dock-able panels, allowing you to move them around freely and display exactly what you want.</li>
       <li xml:lang="ar">تتوفر معلومات واختصارات إضافية كلوحات قابلة للرصف، مما يسمح لك بنقلها بحريّة وعرضها بالضبط كما تريد.</li>
-      <li xml:lang="ast">Tán disponibles atayos ya información adicional como paneles anclables, permitiéndote movelos pehí d'un mou llibre y amosar exautamente lo tu quies.</li>
       <li xml:lang="bs">Dodatne informacije i kratice su dostupne kao usidreni paneli, dopuštajući vam da se krećete slobodno i prikažete šta želite.</li>
       <li xml:lang="ca">Hi ha informació addicional i dreceres disponibles com a plafons que es poden acoblar, permetent moure'ls lliurement i mostrar exactament el què vulgueu.</li>
       <li xml:lang="ca-valencia">Hi ha informació addicional i dreceres disponibles com a plafons que es poden acoblar, permetent moure'ls lliurement i mostrar exactament el què vulgueu.</li>
       <li xml:lang="zh-TW">分割檢視讓您可以輕鬆複製或移動檔案。</li>
       <li>Multiple tab support</li>
       <li xml:lang="ar">دعم تعدّد الألسنة</li>
-      <li xml:lang="ast">Sofitu de múltiples llingüetes</li>
       <li xml:lang="bs">Podrška za više kartica</li>
       <li xml:lang="ca">Admet pestanyes múltiples</li>
       <li xml:lang="ca-valencia">Admet pestanyes múltiples</li>
       <li xml:lang="zh-TW">額外資訊與嵌入式面板捷徑讓您可以輕易顯示您常用的項目。</li>
       <li>Informational dialogues are displayed in an unobtrusive way.</li>
       <li xml:lang="ar">حواريات المعلومات تُعرَض بطريقة غير مُزعجة.</li>
-      <li xml:lang="ast">Los diálogos d'información amuésense d'un mou discretu.</li>
       <li xml:lang="bs">Informativni dijalozi su prikazani na nenametljiv način.</li>
       <li xml:lang="ca">Els diàlegs informatius es mostren d'una manera no molesta.</li>
       <li xml:lang="ca-valencia">Els diàlegs informatius es mostren d'una manera no molesta.</li>
       <li xml:lang="zh-TW">支援多分頁</li>
       <li>Undo/redo support</li>
       <li xml:lang="ar">دعم التراجع والإعادة</li>
-      <li xml:lang="ast">Sofitu de desfechura/refechura</li>
       <li xml:lang="bs">Podrška za poništavanje/ponavljanje akcija</li>
       <li xml:lang="ca">Admet desfer/refer</li>
       <li xml:lang="ca-valencia">Admet desfer/refer</li>
       <li xml:lang="zh-TW">以不唐突的方式顯示資訊對話框。</li>
       <li>Transparent network access through the KIO system.</li>
       <li xml:lang="ar">اتصال شبكيّ مباشر باستخدام نظام KIO.</li>
-      <li xml:lang="ast">Accesu tresparente a la rede pente'l sistema KIO.</li>
       <li xml:lang="bs">Transparentni mrežni pristup kroz KIO sistem.</li>
       <li xml:lang="ca">Accés transparent a la xarxa a través del sistema KIO.</li>
       <li xml:lang="ca-valencia">Accés transparent a la xarxa a través del sistema KIO.</li>
index 276cf567208a2d0de82b6c4e7dc1ca28c846d73d..8b759d813dac6b4fae4d5b2b27cda5a7ff09a2bb 100644 (file)
@@ -260,7 +260,7 @@ void FoldersPanel::slotRoleEditingFinished(int index, const QByteArray& role, co
             KIO::Job* job = KIO::moveAs(oldUrl, newUrl);
             KJobWidgets::setWindow(job, this);
             KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job);
-            job->ui()->setAutoErrorHandlingEnabled(true);
+            job->uiDelegate()->setAutoErrorHandlingEnabled(true);
         }
     }
 }
index ec4186db2c1b2d9f1529d7d9ca934cb0249d080f..51fc229c1906f7c5a7f64ee599c2047a75a0425f 100644 (file)
@@ -201,7 +201,7 @@ void TreeViewContextMenu::moveToTrash()
         KIO::Job* job = KIO::trash(list);
         KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, list, QUrl(QStringLiteral("trash:/")), job);
         KJobWidgets::setWindow(job, m_parent);
-        job->ui()->setAutoErrorHandlingEnabled(true);
+        job->uiDelegate()->setAutoErrorHandlingEnabled(true);
     }
 }
 
@@ -213,7 +213,7 @@ void TreeViewContextMenu::deleteItem()
     if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Delete, KIO::JobUiDelegate::DefaultConfirmation)) {
         KIO::Job* job = KIO::del(list);
         KJobWidgets::setWindow(job, m_parent);
-        job->ui()->setAutoErrorHandlingEnabled(true);
+        job->uiDelegate()->setAutoErrorHandlingEnabled(true);
     }
 }
 
index 3f778b07ac206c1542110069779642758ab9dadc..16dc721b2eb4a0c928bc29634fce0387938c747f 100644 (file)
@@ -185,7 +185,7 @@ void InformationPanel::showItemInfo()
             // No item is hovered and no selection has been done: provide
             // an item for the currently shown directory.
             m_folderStatJob = KIO::stat(url(), KIO::HideProgressInfo);
-            if (m_folderStatJob->ui()) {
+            if (m_folderStatJob->uiDelegate()) {
                 KJobWidgets::setWindow(m_folderStatJob, this);
             }
             connect(m_folderStatJob, &KIO::Job::result,
index f56f5eaf64442cb2dd8df425415adceb27cc037b..fa4868e52bdf10c5ea42546cac9e842e4c6e535e 100644 (file)
@@ -191,7 +191,7 @@ void InformationPanelContent::showItem(const KFileItem& item)
             m_previewJob = new KIO::PreviewJob(KFileItemList() << item, QSize(m_preview->width(), m_preview->height()));
             m_previewJob->setScaleType(KIO::PreviewJob::Unscaled);
             m_previewJob->setIgnoreMaximumSize(item.isLocalFile());
-            if (m_previewJob->ui()) {
+            if (m_previewJob->uiDelegate()) {
                 KJobWidgets::setWindow(m_previewJob, this);
             }
 
index e4885ab760acc968cf87a7b503646546aa0e98b9..ac4a32506d179eb3a869b52dab8e5d63cfd94856 100644 (file)
@@ -52,7 +52,7 @@ class EmbeddedVideoPlayer : public Phonon::VideoWidget
             updateGeometry();
         }
 
-        virtual QSize sizeHint() const
+        QSize sizeHint() const Q_DECL_OVERRIDE
         {
             return m_sizeHint.isValid() ? m_sizeHint : Phonon::VideoWidget::sizeHint();
         }
index 25c4d51f67eaed8440ac5ab73f28d6702b975401..8a02ead015b71e36714a6927de4412ddbda7088d 100644 (file)
@@ -872,7 +872,7 @@ PlacesItem* PlacesItemModel::createSystemPlacesItem(const SystemBookmarkData& da
                 props.setVisibleRoles({"text"});
             } else if (data.url.scheme() == QLatin1String("timeline")) {
                 props.setViewMode(DolphinView::DetailsView);
-                props.setVisibleRoles({"text", "date"});
+                props.setVisibleRoles({"text", "modificationtime"});
             }
         }
     }
index da68210c12e4610dcbfc233c257887aaac8493c9..e952f23a0a74f17c2df0af50f24dececa9f35127 100644 (file)
@@ -137,7 +137,7 @@ void TerminalPanel::changeDir(const QUrl& url)
         sendCdToTerminal(url.toLocalFile());
     } else {
         m_mostLocalUrlJob = KIO::mostLocalUrl(url, KIO::HideProgressInfo);
-        if (m_mostLocalUrlJob->ui()) {
+        if (m_mostLocalUrlJob->uiDelegate()) {
             KJobWidgets::setWindow(m_mostLocalUrlJob, this);
         }
         connect(m_mostLocalUrlJob, &KIO::StatJob::result, this, &TerminalPanel::slotMostLocalUrlResult);
index 60a4a7567acb8d631a8d9617170a80e27a70ea52..5d5906b789579d033153187101c291bc681e82c2 100644 (file)
@@ -26,6 +26,7 @@
 #include <QLineEdit>
 #include <KLocalizedString>
 #include <KSeparator>
+#include <KNS3/KMoreToolsMenuFactory>
 
 #include <QButtonGroup>
 #include <QDir>
@@ -385,6 +386,20 @@ void DolphinSearchBox::init()
     searchLocationGroup->addButton(m_fromHereButton);
     searchLocationGroup->addButton(m_everywhereButton);
 
+    auto moreSearchToolsButton = new QToolButton(this);
+    moreSearchToolsButton->setAutoRaise(true);
+    moreSearchToolsButton->setPopupMode(QToolButton::InstantPopup);
+    moreSearchToolsButton->setIcon(QIcon::fromTheme("arrow-down-double"));
+    moreSearchToolsButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
+    moreSearchToolsButton->setText(i18n("More Search Tools"));
+    moreSearchToolsButton->setMenu(new QMenu(this));
+    connect(moreSearchToolsButton->menu(), &QMenu::aboutToShow, moreSearchToolsButton->menu(), [this, moreSearchToolsButton]()
+    {
+        m_menuFactory.reset(new KMoreToolsMenuFactory("dolphin/search-tools"));
+        moreSearchToolsButton->menu()->clear();
+        m_menuFactory->fillMenuFromGroupingNames(moreSearchToolsButton->menu(), { "files-find" }, this->m_searchPath);
+    } );
+
     // Create "Facets" widgets
     m_facetsToggleButton = new QToolButton(this);
     m_facetsToggleButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
@@ -404,8 +419,10 @@ void DolphinSearchBox::init()
     optionsLayout->addWidget(m_separator);
     optionsLayout->addWidget(m_fromHereButton);
     optionsLayout->addWidget(m_everywhereButton);
-    optionsLayout->addStretch(1);
+    optionsLayout->addWidget(new KSeparator(Qt::Vertical, this));
     optionsLayout->addWidget(m_facetsToggleButton);
+    optionsLayout->addWidget(moreSearchToolsButton);
+    optionsLayout->addStretch(1);
 
     // Put the options into a QScrollArea. This prevents increasing the view width
     // in case that not enough width for the options is available.
index b747679ec272af8a88dc788612ebb3e00b0b26b9..5063c2bf506e5c79b2e1e2766153f5c7022b2119 100644 (file)
@@ -30,6 +30,7 @@ class QToolButton;
 class QScrollArea;
 class QLabel;
 class QVBoxLayout;
+class KMoreToolsMenuFactory;
 
 /**
  * @brief Input box for searching files with or without Baloo.
@@ -176,6 +177,7 @@ private:
     DolphinFacetsWidget* m_facetsWidget;
 
     QUrl m_searchPath;
+    QScopedPointer<KMoreToolsMenuFactory> m_menuFactory;
 
     QTimer* m_startSearchTimer;
 };
index c724afcd1c0dac12bebe335cfcf7895590a0d832..5878abcbe1f33a5eaa7a073e7b0de422f5ba6825 100644 (file)
             <label>Should the full path be shown inside the location bar</label>
             <default>false</default>
         </entry>
+        <entry name="ShowFullPathInTitlebar" type="Bool">
+            <label>Should the full path be shown in the title bar</label>
+            <default>false</default>
+        </entry>
         <entry name="Version" type="Int">
             <label>Internal version of Dolphin, containing 3 digits for major, minor, bugfix</label>
             <default>0</default>
index 962fb777855e435d943c971d7f623288d625b82e..556231e4433965f6fcd13f3adf28d29f10eaeda7 100644 (file)
@@ -1,6 +1,5 @@
 Name=Dolphin General
 Name[ar]=دولفين العامّ
-Name[ast]=Xeneral de Dolphin
 Name[ca]=General del Dolphin
 Name[ca@valencia]=General del Dolphin
 Name[cs]=Obecný Dolphin
@@ -43,7 +42,6 @@ Name[zh_CN]=Dolphin 常规
 Name[zh_TW]=Dolphin 一般
 Comment=This service allows configuration of general Dolphin settings.
 Comment[ar]=تسمح هذه الخدمة بضبط إعدادات دولفين العامّة.
-Comment[ast]=Esti serviciu permite la configuración de los axustes xenerales de Dolphin.
 Comment[ca]=Aquest servei permet la configuració de l'arranjament general del Dolphin.
 Comment[ca@valencia]=Este servei permet la configuració de l'arranjament general del Dolphin.
 Comment[cs]=Tato služba umožňuje obecné nastavení Dolphinu.
@@ -139,7 +137,6 @@ Name[zh_CN]=常规
 Name[zh_TW]=一般
 Comment=Configure general file manager settings
 Comment[ar]=اضبط إعدادات مدير الملفّات العامّة
-Comment[ast]=Configura los axustes xenerales del xestor de ficheros
 Comment[ca]=Configura les opcions generals del gestor de fitxers
 Comment[ca@valencia]=Configura les opcions generals del gestor de fitxers
 Comment[cs]=Obecné nastavení správce souborů
index eaca4f1419a7c5ce9c3605b7f455b5839a6bde88..9280624d61ed146c880c46fb10a43d84db78e61e 100644 (file)
@@ -1,6 +1,5 @@
 Name=Dolphin Navigation
 Name[ar]=التّنقّل في دولفين
-Name[ast]=Navegación de Dolphin
 Name[ca]=Navegació del Dolphin
 Name[ca@valencia]=Navegació del Dolphin
 Name[cs]=Navigace Dolphinu
@@ -43,7 +42,6 @@ Name[zh_CN]=Dolphin 导航
 Name[zh_TW]=Dolphin 導覽
 Comment=This service allows configuration of the Dolphin navigation.
 Comment[ar]=تسمح هذه الخدمة بضبط التّنقّل في دولفين.
-Comment[ast]=Esti serviciu permite la configuración de la navegación de Dolphin.
 Comment[ca]=Aquest servei permet la configuració de la navegació del Dolphin.
 Comment[ca@valencia]=Este servei permet la configuració de la navegació del Dolphin.
 Comment[cs]=Tato služba umožňuje nastavení navigace v Dolphinu.
@@ -139,7 +137,6 @@ Name[zh_CN]=导航
 Name[zh_TW]=導覽
 Comment=Configure file manager navigation
 Comment[ar]=اضبط التّنقّل في مدير الملفّات
-Comment[ast]=Configura la navegación del xestor de ficheros
 Comment[ca]=Configura la navegació del gestor de fitxers
 Comment[ca@valencia]=Configura la navegació del gestor de fitxers
 Comment[cs]=Nastavení navigace správce souborů
index 1775f7eff719ce3530122278ccad715580a2f3b3..42e0538fa956f80459049ae6975ee65ecd71f6e7 100644 (file)
@@ -95,7 +95,6 @@ Name[zh_CN]=服务
 Name[zh_TW]=服務
 Comment=Configure file manager services
 Comment[ar]=اضبط خدمات مدير الملفّات
-Comment[ast]=Configura los servicios del xestor de ficheros
 Comment[ca]=Configura els serveis del gestor de fitxers
 Comment[ca@valencia]=Configura els serveis del gestor de fitxers
 Comment[cs]=Nastavení služeb správce souborů
index d1b5abe49a4293b4c03899bbaff9ea78f77c9fbf..0be2656a010c586063195f9e08f754592a7e70ba 100644 (file)
@@ -1,6 +1,5 @@
 Name=Dolphin View Modes
 Name[ar]=أوضاع المنظور في دولفين
-Name[ast]=Moos de vista de Dolphin
 Name[ca]=Modes de vista del Dolphin
 Name[ca@valencia]=Modes de vista del Dolphin
 Name[cs]=Režimy pohledů Dolphinu
@@ -43,7 +42,6 @@ Name[zh_CN]=Dolphin 视图模式
 Name[zh_TW]=設定檔案管理員服務
 Comment=This service allows configuration of the Dolphin view modes.
 Comment[ar]=تسمح هذه الخدمة بضبط أوضاع المنظور في دولفين.
-Comment[ast]=Esti serviciu permite la configuración de los moos de vista de Dolphin.
 Comment[ca]=Aquest servei permet la configuració dels modes de vista del Dolphin.
 Comment[ca@valencia]=Este servei permet la configuració dels modes de vista del Dolphin.
 Comment[cs]=Tato služba umožňuje nastavení režimů pohledu Dolphinu.
@@ -96,7 +94,6 @@ X-KDE-ParentApp=kcontrol
 X-DocPath=dolphin/index.html#preferences-dialog-viewmodes
 Name=View Modes
 Name[ar]=أوضاع المنظور
-Name[ast]=Moos de vista
 Name[ca]=Modes de vista
 Name[ca@valencia]=Modes de vista
 Name[cs]=Režimy pohledu
@@ -139,7 +136,6 @@ Name[zh_CN]=视图模式
 Name[zh_TW]=檢視模式
 Comment=Configure file manager view modes
 Comment[ar]=اضبط أوضاع المنظور في مدير الملفّات
-Comment[ast]=Configura los moos de vista del xestor de ficheros
 Comment[ca]=Configura els modes de vista del gestor de fitxers
 Comment[ca@valencia]=Configura els modes de vista del gestor de fitxers
 Comment[cs]=Nastavení režimů pohledu správce souborů
index 6554493d8066ab6a67c2ed633655e7ff6aed1d89..f076f16c74e56c04acfb59de9a5b2be4c06dfbf6 100644 (file)
@@ -46,7 +46,8 @@ StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) :
     m_splitView(0),
     m_editableUrl(0),
     m_showFullPath(0),
-    m_filterBar(0)
+    m_filterBar(0),
+    m_showFullPathInTitlebar(0)
 {
     QVBoxLayout* topLayout = new QVBoxLayout(this);
     QWidget* vBox = new QWidget(this);
@@ -104,6 +105,8 @@ StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) :
     vBoxLayout->addWidget(m_showFullPath);
     m_filterBar = new QCheckBox(i18nc("@option:check Startup Settings", "Show filter bar"), vBox);
     vBoxLayout->addWidget(m_filterBar);
+    m_showFullPathInTitlebar = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path in title bar"), vBox);
+    vBoxLayout->addWidget(m_showFullPathInTitlebar);
 
     // Add a dummy widget with no restriction regarding
     // a vertical resizing. This assures that the dialog layout
@@ -119,6 +122,7 @@ StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) :
     connect(m_editableUrl,  &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
     connect(m_showFullPath, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
     connect(m_filterBar,    &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
+    connect(m_showFullPathInTitlebar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
 }
 
 StartupSettingsPage::~StartupSettingsPage()
@@ -141,6 +145,7 @@ void StartupSettingsPage::applySettings()
     settings->setEditableUrl(m_editableUrl->isChecked());
     settings->setShowFullPath(m_showFullPath->isChecked());
     settings->setFilterBar(m_filterBar->isChecked());
+    settings->setShowFullPathInTitlebar(m_showFullPathInTitlebar->isChecked());
 
     settings->save();
 }
@@ -190,4 +195,5 @@ void StartupSettingsPage::loadSettings()
     m_editableUrl->setChecked(GeneralSettings::editableUrl());
     m_showFullPath->setChecked(GeneralSettings::showFullPath());
     m_filterBar->setChecked(GeneralSettings::filterBar());
+    m_showFullPathInTitlebar->setChecked(GeneralSettings::showFullPathInTitlebar());
 }
index 9bcc3113171bbef5b5fdae186254a5bbe383cec0..7a69cd3d61b42f479db7c19e2db8c2848b5696d8 100644 (file)
@@ -62,6 +62,7 @@ private:
     QCheckBox* m_editableUrl;
     QCheckBox* m_showFullPath;
     QCheckBox* m_filterBar;
+    QCheckBox* m_showFullPathInTitlebar;
 };
 
 #endif
index 7407042d748f1d838210f4b9744cb54bcd39da47..c317ed052edebbbf8afc73ed3943c7dae1d3c3de 100644 (file)
@@ -303,7 +303,7 @@ void ViewPropertiesDialog::configureAdditionalInfo()
         visibleRoles.clear();
         visibleRoles.append("text");
         visibleRoles.append("size");
-        visibleRoles.append("date");
+        visibleRoles.append("modificationtime");
         m_viewProps->setVisibleRoles(visibleRoles);
     }
 
index 6c45e114b65166888322936b842adc2aad7a155e..59ff63069b47eed1869b9ffbb77458e6ab4cd401 100644 (file)
@@ -154,9 +154,9 @@ void KFileItemModelTest::testDefaultSortRole()
     QVERIFY(itemsInsertedSpy.wait());
 
     QCOMPARE(m_model->count(), 3);
-    QCOMPARE(m_model->data(0)["text"].toString(), QString("a.txt"));
-    QCOMPARE(m_model->data(1)["text"].toString(), QString("b.txt"));
-    QCOMPARE(m_model->data(2)["text"].toString(), QString("c.txt"));
+    QCOMPARE(m_model->data(0).value("text").toString(), QString("a.txt"));
+    QCOMPARE(m_model->data(1).value("text").toString(), QString("b.txt"));
+    QCOMPARE(m_model->data(2).value("text").toString(), QString("c.txt"));
 }
 
 void KFileItemModelTest::testDefaultGroupedSorting()
@@ -882,8 +882,8 @@ void KFileItemModelTest::testSorting()
 
     // Sort by Date, descending
     m_model->setSortDirectoriesFirst(true);
-    m_model->setSortRole("date");
-    QCOMPARE(m_model->sortRole(), QByteArray("date"));
+    m_model->setSortRole("modificationtime");
+    QCOMPARE(m_model->sortRole(), QByteArray("modificationtime"));
     QCOMPARE(m_model->sortOrder(), Qt::DescendingOrder);
     QCOMPARE(itemsInModel(), QStringList() << "c" << "c-2" << "c-3" << "c-1" << "b" << "d" << "a" << "e");
     QCOMPARE(itemsMovedSpy.count(), 1);
@@ -892,7 +892,7 @@ void KFileItemModelTest::testSorting()
 
     // Sort by Date, ascending
     m_model->setSortOrder(Qt::AscendingOrder);
-    QCOMPARE(m_model->sortRole(), QByteArray("date"));
+    QCOMPARE(m_model->sortRole(), QByteArray("modificationtime"));
     QCOMPARE(m_model->sortOrder(), Qt::AscendingOrder);
     QCOMPARE(itemsInModel(), QStringList() << "c" << "c-2" << "c-3" << "c-1" << "e" << "a" << "d" << "b");
     QCOMPARE(itemsMovedSpy.count(), 1);
@@ -901,7 +901,7 @@ void KFileItemModelTest::testSorting()
 
     // Sort by Date, ascending, 'Sort Folders First' disabled
     m_model->setSortDirectoriesFirst(false);
-    QCOMPARE(m_model->sortRole(), QByteArray("date"));
+    QCOMPARE(m_model->sortRole(), QByteArray("modificationtime"));
     QCOMPARE(m_model->sortOrder(), Qt::AscendingOrder);
     QVERIFY(!m_model->sortDirectoriesFirst());
     QCOMPARE(itemsInModel(), QStringList() << "e" << "a" << "c" << "c-1" << "c-2" << "c-3" << "d" << "b");
index e170e7b5b2b58b89a15bcdebbbe2b554158ba7c3..92d05c4d452d3d68ebf1b4fcf1f2d929db8bca08 100644 (file)
@@ -37,6 +37,7 @@
  */
 class KItemListControllerTestStyle : public QProxyStyle
 {
+    Q_OBJECT
 public:
     KItemListControllerTestStyle(QStyle* style) :
         QProxyStyle(style),
index b183de3026924578cecd11fa9e45f596edaf6e34..18a79bd3f3c1c01bf3eb373d061351d641e4c5aa 100644 (file)
 
 class DummyModel : public KItemModelBase
 {
+    Q_OBJECT
 public:
     DummyModel();
     void setCount(int count);
-    virtual int count() const;
-    virtual QHash<QByteArray, QVariant> data(int index) const;
+    int count() const Q_DECL_OVERRIDE;
+    QHash<QByteArray, QVariant> data(int index) const Q_DECL_OVERRIDE;
 
 private:
     int m_count;
index 0d14e20fa62f785cf2b2fd69f134a91ab3633d90..d319939476caa3ce4807d3359a2bbbd74130d659 100644 (file)
@@ -22,7 +22,7 @@
 #include <QTest>
 #include <QVector>
 
-Q_DECLARE_METATYPE(KItemRangeList);
+Q_DECLARE_METATYPE(KItemRangeList)
 
 /**
  * Converts a KItemRangeList to a KItemSet.
@@ -72,14 +72,14 @@ QVector<int> KItemRangeList2QVector(const KItemRangeList& itemRanges)
 static QSet<int> KItemSet2QSet(const KItemSet& itemSet)
 {
     QSet<int> result;
-    foreach (int i, itemSet) {
+    for (int i : itemSet) {
         result.insert(i);
     }
 
     // Check that the conversion was successful.
     Q_ASSERT(itemSet.count() == result.count());
 
-    foreach (int i, itemSet) {
+    for (int i : itemSet) {
         Q_ASSERT(result.contains(i));
     }
 
@@ -239,7 +239,7 @@ void KItemSetTest::testIterators()
     QCOMPARE(testQVector, itemsQVector);
 
     testQVector.clear();
-    foreach (int i, itemSet) {
+    for (int i : itemSet) {
         testQVector.append(i);
     }
     QCOMPARE(testQVector, itemsQVector);
index 482e4127d7c78d71a7ae7f508e5535427817eb1b..114afdc33c9082830cc545eb7ee27f01125e7157 100644 (file)
@@ -44,6 +44,7 @@ void ViewPropertiesTest::init()
 {
     m_globalViewProps = GeneralSettings::self()->globalViewProps();
     GeneralSettings::self()->setGlobalViewProps(false);
+    GeneralSettings::self()->save();
 
     // It is mandatory to create the test-directory inside the home-directory
     // of the user: ViewProperties does not write inside directories
@@ -58,6 +59,7 @@ void ViewPropertiesTest::cleanup()
     m_testDir = 0;
 
     GeneralSettings::self()->setGlobalViewProps(m_globalViewProps);
+    GeneralSettings::self()->save();
 }
 
 /**
index 7d85fa240c36027e25ad9ff950ad4515695340bf..f5ba63d1ee41511cb06f43353dd90180c527c6f3 100644 (file)
@@ -1534,7 +1534,7 @@ void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, con
             KIO::Job * job = KIO::moveAs(oldUrl, newUrl);
             KJobWidgets::setWindow(job, this);
             KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job);
-            job->ui()->setAutoErrorHandlingEnabled(true);
+            job->uiDelegate()->setAutoErrorHandlingEnabled(true);
 
             if (!newNameExistsAlready) {
                 // Only connect the result signal if there is no item with the new name
index a514ede1e7d5b1a7858dcd2b22a756802037da7a..c73f003a8b61ce8187d6874217ba659d9e0d5db4 100644 (file)
@@ -162,7 +162,7 @@ void RenameDialog::renameItem(const KFileItem &item, const QString& newName)
     KIO::Job * job = KIO::moveAs(oldUrl, newUrl);
     KJobWidgets::setWindow(job, widget);
     KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job);
-    job->ui()->setAutoErrorHandlingEnabled(true);
+    job->uiDelegate()->setAutoErrorHandlingEnabled(true);
 }
 
 void RenameDialog::slotAccepted()
index 0636df795b0ee9c80fe72ad6ef8269d09fab5b34..404d6801cc3dd00a2f64d6f0d1f3e0893bcbb467 100644 (file)
@@ -130,7 +130,7 @@ void ToolTipManager::startContentRetrieval()
 
     KIO::PreviewJob* job = new KIO::PreviewJob(KFileItemList() << m_item, QSize(256, 256));
     job->setIgnoreMaximumSize(m_item.isLocalFile());
-    if (job->ui()) {
+    if (job->uiDelegate()) {
         KJobWidgets::setWindow(job, qApp->activeWindow());
     }
 
index cdec01b9dcdc7123b1abe371b24157f4a021afec..67951cfe7445a1a0b8ef789b7c4b166c17f8e6ff 100644 (file)
@@ -2,7 +2,6 @@
 Type=ServiceType
 X-KDE-ServiceType=FileViewVersionControlPlugin
 Comment=Version Control Plugin for File Views
-Comment[ast]=Complementu de control de versiones pa vistes de ficheros
 Comment[ca]=Connector de control de versions per a les vistes de fitxers
 Comment[ca@valencia]=Connector de control de versions per a les vistes de fitxers
 Comment[cs]=Modul pro správu verzí pro pohledy na soubory
index 597baa29392bd5d6d62b03d97d5c1e26ac5d0582..ca52be8907cee97063f2f0ec655b052b348221aa 100644 (file)
@@ -35,7 +35,8 @@
 namespace {
     const int AdditionalInfoViewPropertiesVersion = 1;
     const int NameRolePropertiesVersion = 2;
-    const int CurrentViewPropertiesVersion = 3;
+    const int DateRolePropertiesVersion = 4;
+    const int CurrentViewPropertiesVersion = 4;
 
     // String representation to mark the additional properties of
     // the details view as customized by the user. See
@@ -123,6 +124,11 @@ ViewProperties::ViewProperties(const QUrl& url) :
             Q_ASSERT(m_node->version() == NameRolePropertiesVersion);
         }
 
+        if (m_node->version() < DateRolePropertiesVersion) {
+            convertDateRoleToModificationTimeRole();
+            Q_ASSERT(m_node->version() == DateRolePropertiesVersion);
+        }
+
         m_node->setVersion(CurrentViewPropertiesVersion);
     }
 }
@@ -309,7 +315,7 @@ QList<QByteArray> ViewProperties::visibleRoles() const
                                   && !visibleRoles.contains(CustomizedDetailsString);
     if (useDefaultValues) {
         roles.append("size");
-        roles.append("date");
+        roles.append("modificationtime");
     }
 
     return roles;
@@ -448,6 +454,27 @@ void ViewProperties::convertNameRoleToTextRole()
     update();
 }
 
+void ViewProperties::convertDateRoleToModificationTimeRole()
+{
+    QStringList visibleRoles = m_node->visibleRoles();
+    for (int i = 0; i < visibleRoles.count(); ++i) {
+        if (visibleRoles[i].endsWith(QLatin1String("_date"))) {
+            const int leftLength = visibleRoles[i].length() - 5;
+            visibleRoles[i] = visibleRoles[i].left(leftLength) + "_modificationtime";
+        }
+    }
+
+    QString sortRole = m_node->sortRole();
+    if (sortRole == QLatin1String("date")) {
+        sortRole = QStringLiteral("modificationtime");
+    }
+
+    m_node->setVisibleRoles(visibleRoles);
+    m_node->setSortRole(sortRole);
+    m_node->setVersion(DateRolePropertiesVersion);
+    update();
+}
+
 bool ViewProperties::isPartOfHome(const QString& filePath)
 {
     // For performance reasons cache the path in a static QString
index dc118e2d761f16d8c8b7069b8e8216a9855ee9ef..05b80f45551d0e3419a178360a1e360125600c2a 100644 (file)
@@ -153,6 +153,12 @@ private:
      */
     void convertNameRoleToTextRole();
 
+    /**
+     * Provides backward compatibility with .directory files created with
+     * Dolphin < 16.11.70: Converts the old name-role "date" to "modificationtime"
+     */
+
+    void convertDateRoleToModificationTimeRole();
     /**
      * Returns true, if \a filePath is part of the home-path (see QDir::homePath()).
      */