Code cleanup and this-> removals.
authorDominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
Tue, 19 May 2020 21:25:21 +0000 (23:25 +0200)
committerDominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
Tue, 19 May 2020 21:25:21 +0000 (23:25 +0200)
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
src/gui/owncloudgui.cpp
src/gui/systray.h
src/gui/tray/ActivityListModel.cpp
src/gui/tray/Window.qml

index bc340e54225a2c4b80ddfde7f2c8c99d28baace9..dde22a5723a2183bf1b29ef4085627f714c98d5a 100644 (file)
@@ -90,13 +90,11 @@ ownCloudGui::ownCloudGui(Application *parent)
     connect(_tray.data(), &Systray::shutdown,
         this, &ownCloudGui::slotShutdown);
     connect(_tray.data(), &Systray::openShareDialog,
-        this, [=](const QString &sharePath, const QString &localPath, const bool publicLink = false)
-            {
-
+        this, [=](const QString &sharePath, const QString &localPath, bool publicLink = false) {
                 if (publicLink) {
-                    this->slotShowShareDialog(sharePath,localPath, ShareDialogStartPage::PublicLinks);
+                    slotShowShareDialog(sharePath,localPath, ShareDialogStartPage::PublicLinks);
                 } else {
-                    this->slotShowShareDialog(sharePath,localPath, ShareDialogStartPage::UsersAndGroups);
+                    slotShowShareDialog(sharePath,localPath, ShareDialogStartPage::UsersAndGroups);
                 }
             });
 
index 2710be568f50821f66a126908db926bac2574e90..e8683df7d892ab017d6ae2d881fb0cdb77e1ce11 100644 (file)
@@ -69,7 +69,7 @@ signals:
 
     Q_INVOKABLE void hideWindow();
     Q_INVOKABLE void showWindow();
-    Q_INVOKABLE void openShareDialog(const QString &sharepath, const QString &localPath);
+    Q_INVOKABLE void openShareDialog(const QString &sharePath, const QString &localPath);
 
 public slots:
     void slotNewUserSelected();
index 14381cbe91f008e6da76c98b86e0c12a5837de6a..b183ca7fc39ad7b10a10e7dd18e39894837f024e 100644 (file)
@@ -43,9 +43,9 @@ ActivityListModel::ActivityListModel(AccountState *accountState, QObject *parent
 QHash<int, QByteArray> ActivityListModel::roleNames() const
 {
     QHash<int, QByteArray> roles;
-    roles[DisplayPathRole] = "displaypath";
+    roles[DisplayPathRole] = "displayPath";
     roles[PathRole] = "path";
-    roles[AbsolutePathRole] = "abspath";
+    roles[AbsolutePathRole] = "absolutePath";
     roles[LinkRole] = "link";
     roles[MessageRole] = "message";
     roles[ActionRole] = "type";
@@ -109,15 +109,15 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const
         }
         return QString();
     case AbsolutePathRole: {
-        auto folder = FolderMan::instance()->folder(a._folder);
+        const auto folder = FolderMan::instance()->folder(a._folder);
         QString relPath(a._file);
         if (!a._file.isEmpty()) {
             if (folder) {
                 relPath.prepend(folder->remotePath());
             }
             list = FolderMan::instance()->findFileInLocalFolders(relPath, ast->account());
-            if (list.count() > 0) {
-                return QString(list.at(0));
+            if (!list.empty()) {
+                return list.at(0);
             } else {
                 qWarning("File not local folders while processing absolute path request.");
                 return QString();
index e4f74d2f377d243c48327932222519d38af495fa..ac1fa9848502c13df5713a9d410db4176daad75f 100644 (file)
@@ -555,7 +555,7 @@ Window {
                 spacing: 0\r
 \r
                 MouseArea {\r
-                    enabled: (path !== "") ? true : false\r
+                    enabled: (path !== "")\r
                     anchors.left: activityItem.left\r
                     anchors.right: ((shareButton.visible) ? shareButton.left : activityItem.right)\r
                     height: parent.height\r
@@ -602,7 +602,7 @@ Window {
 \r
                     Text {\r
                         id: activityTextInfo\r
-                        text: (type === "Activity" || type === "Sync") ? displaypath : ((type === "File") ? subject : message)\r
+                        text: (type === "Activity" || type === "Sync") ? displayPath : ((type === "File") ? subject : message)\r
                         height: (text === "") ? 0 : activityTextTitle.height\r
                         width: Style.activityLabelBaseWidth + ((path === "") ? activityItem.height : 0) + ((link === "") ? activityItem.height : 0) - 8\r
                         elide: Text.ElideRight\r
@@ -638,7 +638,7 @@ Window {
                     ToolTip.visible: hovered\r
                     ToolTip.delay: 1000\r
                     ToolTip.text: qsTr("Open share dialog")\r
-                    onClicked: systrayBackend.openShareDialog(displaypath,abspath)\r
+                    onClicked: systrayBackend.openShareDialog(displayPath,absolutePath)\r
                 }\r
             }\r
 \r