┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
Diffstat (limited to 'src/views')
-rw-r--r--src/views/dolphinview.cpp2
-rw-r--r--src/views/renamedialog.cpp2
-rw-r--r--src/views/tooltips/tooltipmanager.cpp2
-rw-r--r--src/views/versioncontrol/fileviewversioncontrolplugin.desktop1
-rw-r--r--src/views/viewproperties.cpp31
-rw-r--r--src/views/viewproperties.h6
6 files changed, 38 insertions, 6 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 7d85fa240..f5ba63d1e 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -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
diff --git a/src/views/renamedialog.cpp b/src/views/renamedialog.cpp
index cf8f6885d..df4827b3a 100644
--- a/src/views/renamedialog.cpp
+++ b/src/views/renamedialog.cpp
@@ -162,7 +162,7 @@ void RenameDialog::renameItem(const KFileItem &item, const QString& newName)
KIO::Job * job = KIO::moveAs(oldUrl, newUrl, KIO::HideProgressInfo);
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()
diff --git a/src/views/tooltips/tooltipmanager.cpp b/src/views/tooltips/tooltipmanager.cpp
index 0636df795..404d6801c 100644
--- a/src/views/tooltips/tooltipmanager.cpp
+++ b/src/views/tooltips/tooltipmanager.cpp
@@ -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());
}
diff --git a/src/views/versioncontrol/fileviewversioncontrolplugin.desktop b/src/views/versioncontrol/fileviewversioncontrolplugin.desktop
index cdec01b9d..67951cfe7 100644
--- a/src/views/versioncontrol/fileviewversioncontrolplugin.desktop
+++ b/src/views/versioncontrol/fileviewversioncontrolplugin.desktop
@@ -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
diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp
index 597baa293..ca52be890 100644
--- a/src/views/viewproperties.cpp
+++ b/src/views/viewproperties.cpp
@@ -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
diff --git a/src/views/viewproperties.h b/src/views/viewproperties.h
index dc118e2d7..05b80f455 100644
--- a/src/views/viewproperties.h
+++ b/src/views/viewproperties.h
@@ -154,6 +154,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()).
*/
static bool isPartOfHome(const QString& filePath);