Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2021-10-15 12:02:37 +0300
committerHannah von Reth <hannah.vonreth@owncloud.com>2021-10-15 12:02:37 +0300
commit1052526a61cc591121a7f633f5b8dd430ae1e314 (patch)
treeedbf153bd5b6db89e34443ae6024dcb66ded9490 /src
parent6886b6af56f1264b972829e0f53995e851c7f9f2 (diff)
parentcfa0554a18e3543951e51f0f0b2dc0ccf58a4e41 (diff)
Merge remote-tracking branch 'origin/2.9'
Diffstat (limited to 'src')
-rw-r--r--src/gui/accountsettings.cpp2
-rw-r--r--src/gui/folderstatusdelegate.h3
-rw-r--r--src/gui/folderstatusmodel.cpp11
-rw-r--r--src/gui/libcloudproviders/libcloudproviders.cmake2
-rw-r--r--src/gui/settingsdialog.cpp1
5 files changed, 11 insertions, 8 deletions
diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp
index 016b786f0..2ac102159 100644
--- a/src/gui/accountsettings.cpp
+++ b/src/gui/accountsettings.cpp
@@ -247,7 +247,7 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
QModelIndex index = tv->indexAt(pos);
if (!index.isValid()) {
return;
- } else if (!(index.flags() & Qt::ItemIsEnabled)) {
+ } else if (!_model->data(index, FolderStatusDelegate::IsReady).toBool()) {
QMenu *menu = new QMenu(tv);
menu->setAttribute(Qt::WA_DeleteOnClose);
removeFolderAction(menu);
diff --git a/src/gui/folderstatusdelegate.h b/src/gui/folderstatusdelegate.h
index d919e646a..ab207300f 100644
--- a/src/gui/folderstatusdelegate.h
+++ b/src/gui/folderstatusdelegate.h
@@ -47,8 +47,9 @@ public:
AddButton, // 1 = enabled; 2 = disabled
FolderSyncText,
- DataRoleCount
+ DataRoleCount,
+ IsReady // boolean
};
void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override;
QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const override;
diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp
index 8e3caece7..6f2f40fe5 100644
--- a/src/gui/folderstatusmodel.cpp
+++ b/src/gui/folderstatusmodel.cpp
@@ -107,11 +107,10 @@ Qt::ItemFlags FolderStatusModel::flags(const QModelIndex &index) const
return nullptr;
}
- auto flags = Qt::ItemIsEnabled;
- if (_folders.size() > index.row()) {
- const SubFolderInfo &folderInfo = _folders.at(index.row());
- flags = folderInfo._folder->isReady() ? Qt::ItemIsEnabled : Qt::NoItemFlags;
- }
+ // Always enable the item. If it isn't enabled, it cannot be in the selection model, so all
+ // actions from the context menu and the pop-up menu will have some other model index than the
+ // one under the mouse cursor!
+ const auto flags = Qt::ItemIsEnabled;
switch (classify(index)) {
case AddButton: {
@@ -271,6 +270,8 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const
return progress._overallSyncString;
case FolderStatusDelegate::FolderSyncText:
return tr("Local folder: %1").arg(f->shortGuiLocalPath());
+ case FolderStatusDelegate::IsReady:
+ return f->isReady();
}
return QVariant();
}
diff --git a/src/gui/libcloudproviders/libcloudproviders.cmake b/src/gui/libcloudproviders/libcloudproviders.cmake
index 719d6e3e7..90a628da1 100644
--- a/src/gui/libcloudproviders/libcloudproviders.cmake
+++ b/src/gui/libcloudproviders/libcloudproviders.cmake
@@ -31,7 +31,7 @@ if(WITH_LIBCLOUDPROVIDERS)
configure_file(libcloudproviders/cloud-provider.ini.in ${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_CLOUDPROVIDERS_DBUS_NAME}.ini)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_CLOUDPROVIDERS_DBUS_NAME}.ini
- DESTINATION "${DATADIR}/cloud-providers")
+ DESTINATION "${DATA_INSTALL_DIR}/cloud-providers")
message("Building with libcloudproviders")
elseif(UNIX AND NOT APPLE)
diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp
index 3aad0f75c..1b72e2c18 100644
--- a/src/gui/settingsdialog.cpp
+++ b/src/gui/settingsdialog.cpp
@@ -336,6 +336,7 @@ bool SettingsDialog::nativeEvent(const QByteArray &eventType, void *message, lon
// so they never receive WM_ENDSESSION
// Capture the event and go down in style
if (msg->message == WM_QUERYENDSESSION || msg->message == WM_ENDSESSION) {
+ qCInfo(lcApplication) << "Shutting down" << *msg;
QTimer::singleShot(0, ocApp(), Application::quit);
}
return false;