From 10ee6ffa4905c03a4b77149fb296bee637415ba4 Mon Sep 17 00:00:00 2001 From: reionwong Date: Wed, 15 Sep 2021 15:46:38 +0800 Subject: [PATCH] Update interface name --- desktop/desktop.cpp | 6 +++--- desktop/desktopsettings.cpp | 6 +++--- dialogs/filepropertiesdialog.cpp | 13 +++++++++---- model/foldermodel.cpp | 4 ++-- qml/Desktop/Main.qml | 2 +- qml/FolderGridView.qml | 6 +++--- 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/desktop/desktop.cpp b/desktop/desktop.cpp index c46e272..073dc22 100644 --- a/desktop/desktop.cpp +++ b/desktop/desktop.cpp @@ -26,9 +26,9 @@ Desktop::Desktop(QObject *parent) : QObject(parent) - , m_dockInterface("org.cutefish.Dock", + , m_dockInterface("com.cutefish.Dock", "/Dock", - "org.cutefish.Dock", QDBusConnection::sessionBus()) + "com.cutefish.Dock", QDBusConnection::sessionBus()) , m_leftMargin(0) , m_rightMargin(0) , m_bottomMargin(0) @@ -39,7 +39,7 @@ Desktop::Desktop(QObject *parent) connect(&m_dockInterface, SIGNAL(directionChanged()), this, SLOT(updateMargins())); connect(&m_dockInterface, SIGNAL(visibilityChanged()), this, SLOT(updateMargins())); } else { - QDBusServiceWatcher *watcher = new QDBusServiceWatcher("org.cutefish.Dock", + QDBusServiceWatcher *watcher = new QDBusServiceWatcher("com.cutefish.Dock", QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForUnregistration, this); diff --git a/desktop/desktopsettings.cpp b/desktop/desktopsettings.cpp index 3298c39..3b560ff 100644 --- a/desktop/desktopsettings.cpp +++ b/desktop/desktopsettings.cpp @@ -24,13 +24,13 @@ DesktopSettings::DesktopSettings(QObject *parent) : QObject(parent) - , m_interface("org.cutefish.Settings", - "/Theme", "org.cutefish.Theme", + , m_interface("com.cutefish.Settings", + "/Theme", "com.cutefish.Theme", QDBusConnection::sessionBus(), this) { QDBusServiceWatcher *watcher = new QDBusServiceWatcher(this); watcher->setConnection(QDBusConnection::sessionBus()); - watcher->addWatchedService("org.cutefish.Settings"); + watcher->addWatchedService("com.cutefish.Settings"); connect(watcher, &QDBusServiceWatcher::serviceRegistered, this, &DesktopSettings::init); init(); diff --git a/dialogs/filepropertiesdialog.cpp b/dialogs/filepropertiesdialog.cpp index e181ec6..d0165a7 100644 --- a/dialogs/filepropertiesdialog.cpp +++ b/dialogs/filepropertiesdialog.cpp @@ -201,6 +201,7 @@ void FilePropertiesDialog::init() if (!m_multiple) { KFileItem item = m_items.first(); + QFileInfo info(item.url().toLocalFile()); QString path; m_fileName = m_items.first().name(); @@ -212,11 +213,15 @@ void FilePropertiesDialog::init() m_mimeType = m_items.first().mimetype(); m_size = KIO::convertSize(m_items.first().size()); - m_location = QFileInfo(m_items.first().localPath()).dir().path(); + m_location = info.dir().path(); - m_creationTime = item.time(KFileItem::CreationTime).toString(); - m_modifiedTime = item.time(KFileItem::ModificationTime).toString(); - m_accessedTime = item.time(KFileItem::AccessTime).toString(); + m_creationTime = info.birthTime().toString(Qt::SystemLocaleLongDate); + m_modifiedTime = info.lastModified().toString(Qt::SystemLocaleLongDate); + m_accessedTime = info.lastRead().toString(Qt::SystemLocaleLongDate); + +// m_creationTime = item.time(KFileItem::CreationTime).toString(); +// m_modifiedTime = item.time(KFileItem::ModificationTime).toString(); +// m_accessedTime = item.time(KFileItem::AccessTime).toString(); m_isWritable = m_items.first().isWritable(); diff --git a/model/foldermodel.cpp b/model/foldermodel.cpp index b42e410..7eb26ac 100644 --- a/model/foldermodel.cpp +++ b/model/foldermodel.cpp @@ -978,8 +978,8 @@ void FolderModel::setWallpaperSelected() if (!url.isLocalFile()) return; - QDBusInterface iface("org.cutefish.Settings", "/Theme", - "org.cutefish.Theme", + QDBusInterface iface("com.cutefish.Settings", "/Theme", + "com.cutefish.Theme", QDBusConnection::sessionBus(), nullptr); if (iface.isValid()) iface.call("setWallpaper", url.toLocalFile()); diff --git a/qml/Desktop/Main.qml b/qml/Desktop/Main.qml index 832258f..25b4b95 100644 --- a/qml/Desktop/Main.qml +++ b/qml/Desktop/Main.qml @@ -69,7 +69,7 @@ Item { isDesktopView: true iconSize: globalSettings.desktopIconSize maximumIconSize: globalSettings.maximumIconSize - minimumIconSize: globalSettings.minimumIconSize + minimumIconSize: 22 focus: true model: dirModel diff --git a/qml/FolderGridView.qml b/qml/FolderGridView.qml index 8682883..32b9d03 100644 --- a/qml/FolderGridView.qml +++ b/qml/FolderGridView.qml @@ -53,7 +53,7 @@ GridView { property var iconSize: settings.gridIconSize property var maximumIconSize: settings.maximumIconSize - property var minimumIconSize: settings.minimumIconSize + property var minimumIconSize: 22 //settings.minimumIconSize property variant cachedRectangleSelection: null @@ -221,7 +221,7 @@ GridView { } cellHeight: { - var iconHeight = iconSize + (FishUI.Units.fontMetrics.height * 3) + FishUI.Units.largeSpacing + var iconHeight = iconSize + (FishUI.Units.fontMetrics.height * 2) + FishUI.Units.largeSpacing * 2 if (isDesktopView) { var extraHeight = calcExtraSpacing(iconHeight, control.height - topMargin - bottomMargin) return iconHeight + extraHeight @@ -628,7 +628,7 @@ GridView { width = targetItem.width - FishUI.Units.smallSpacing height = targetItem.labelArea.paintedHeight + FishUI.Units.largeSpacing * 2 x = targetItem.x + Math.abs(Math.min(control.contentX, control.originX)) - y = pos.y - FishUI.Units.largeSpacing + y = pos.y - FishUI.Units.smallSpacing text = targetItem.labelArea.text targetItem.labelArea.visible = false _editor.select(0, dirModel.fileExtensionBoundary(targetItem.index))