From: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com> Date: Tue, 19 May 2020 21:25:21 +0000 (+0200) Subject: Code cleanup and this-> removals. X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~198^2~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fa9dddf567d67255248040d96f17c9372dbe11f6;p=nextcloud-desktop.git Code cleanup and this-> removals. Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com> --- diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp index bc340e542..dde22a572 100644 --- a/src/gui/owncloudgui.cpp +++ b/src/gui/owncloudgui.cpp @@ -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); } }); diff --git a/src/gui/systray.h b/src/gui/systray.h index 2710be568..e8683df7d 100644 --- a/src/gui/systray.h +++ b/src/gui/systray.h @@ -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(); diff --git a/src/gui/tray/ActivityListModel.cpp b/src/gui/tray/ActivityListModel.cpp index 14381cbe9..b183ca7fc 100644 --- a/src/gui/tray/ActivityListModel.cpp +++ b/src/gui/tray/ActivityListModel.cpp @@ -43,9 +43,9 @@ ActivityListModel::ActivityListModel(AccountState *accountState, QObject *parent QHash ActivityListModel::roleNames() const { QHash 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(); diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index e4f74d2f3..ac1fa9848 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -555,7 +555,7 @@ Window { spacing: 0 MouseArea { - enabled: (path !== "") ? true : false + enabled: (path !== "") anchors.left: activityItem.left anchors.right: ((shareButton.visible) ? shareButton.left : activityItem.right) height: parent.height @@ -602,7 +602,7 @@ Window { Text { id: activityTextInfo - text: (type === "Activity" || type === "Sync") ? displaypath : ((type === "File") ? subject : message) + text: (type === "Activity" || type === "Sync") ? displayPath : ((type === "File") ? subject : message) height: (text === "") ? 0 : activityTextTitle.height width: Style.activityLabelBaseWidth + ((path === "") ? activityItem.height : 0) + ((link === "") ? activityItem.height : 0) - 8 elide: Text.ElideRight @@ -638,7 +638,7 @@ Window { ToolTip.visible: hovered ToolTip.delay: 1000 ToolTip.text: qsTr("Open share dialog") - onClicked: systrayBackend.openShareDialog(displaypath,abspath) + onClicked: systrayBackend.openShareDialog(displayPath,absolutePath) } }