Skip to content

Commit

Permalink
Consistently use folder icon
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOneRing committed Sep 7, 2023
1 parent 7e98b40 commit e0b3cf0
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 34 deletions.
7 changes: 7 additions & 0 deletions changelog/unreleased/11190
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bugfix: Consitently use the same icon for folders

In 4.0 we introduced a new icon for sync connections.
In some places however we continued to use the system provided icon for folders,
this resulted in an inconsitent applicaiton look.

https://github.com/owncloud/client/pull/11190
1 change: 0 additions & 1 deletion src/gui/folderstatusdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

#include "resources/resources.h"

#include <QFileIconProvider>
#include <QPainter>
#include <QApplication>

Expand Down
5 changes: 4 additions & 1 deletion src/gui/folderstatusmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const
case Qt::CheckStateRole:
return x._checked;
case Qt::DecorationRole:
return QFileIconProvider().icon(x._isExternal ? QFileIconProvider::Network : QFileIconProvider::Folder);
if (x._isExternal) {
return QFileIconProvider().icon(QFileIconProvider::Network);
}
return Resources::getCoreIcon(QStringLiteral("folder-sync"));
case Qt::ForegroundRole:
if (x._isUndecided) {
return QColor(Qt::red);
Expand Down
2 changes: 1 addition & 1 deletion src/gui/folderwizard/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ add_library(folderwizard STATIC
spacespage.ui
)

target_link_libraries(folderwizard PUBLIC Qt::Widgets libsync)
target_link_libraries(folderwizard PUBLIC Qt::Widgets libsync owncloudResources)
set_target_properties(folderwizard PROPERTIES AUTOUIC ON AUTORCC ON)
apply_common_target_settings(folderwizard)
7 changes: 3 additions & 4 deletions src/gui/folderwizard/folderwizardremotepath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@

#include "libsync/theme.h"

#include "resources/resources.h"

#include <QDir>
#include <QFileIconProvider>
#include <QInputDialog>

using namespace OCC;
Expand Down Expand Up @@ -161,9 +162,7 @@ void FolderWizardRemotePath::recursiveInsert(QTreeWidgetItem *parent, QStringLis
QTreeWidgetItem *item = findFirstChild(parent, folderName);
if (!item) {
item = new QTreeWidgetItem(parent);
QFileIconProvider prov;
QIcon folderIcon = prov.icon(QFileIconProvider::Folder);
item->setIcon(0, folderIcon);
item->setIcon(0, Resources::getCoreIcon(QStringLiteral("folder-sync")));
item->setText(0, folderName);
item->setData(0, Qt::UserRole, folderPath);
item->setToolTip(0, folderPath);
Expand Down
7 changes: 3 additions & 4 deletions src/gui/selectivesyncwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
#include "libsync/networkjobs.h"
#include "libsync/theme.h"

#include "resources/resources.h"

#include <QDialogButtonBox>
#include <QFileIconProvider>
#include <QHeaderView>
#include <QLabel>
#include <QScopedValueRollback>
Expand Down Expand Up @@ -132,8 +133,6 @@ static QTreeWidgetItem *findFirstChild(QTreeWidgetItem *parent, const QString &t

void SelectiveSyncWidget::recursiveInsert(QTreeWidgetItem *parent, QStringList pathTrail, QString path, qint64 size)
{
QFileIconProvider prov;
QIcon folderIcon = prov.icon(QFileIconProvider::Folder);
if (pathTrail.size() == 0) {
if (path.endsWith(QLatin1Char('/'))) {
path.chop(1);
Expand All @@ -157,7 +156,7 @@ void SelectiveSyncWidget::recursiveInsert(QTreeWidgetItem *parent, QStringList p
} else if (parent->checkState(0) == Qt::Unchecked) {
item->setCheckState(0, Qt::Unchecked);
}
item->setIcon(0, folderIcon);
item->setIcon(0, Resources::getCoreIcon(QStringLiteral("folder-sync")));
item->setText(0, pathTrail.first());
if (size >= 0) {
item->setText(1, Utility::octetsToString(size));
Expand Down
8 changes: 3 additions & 5 deletions src/gui/sharedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
#include "configfile.h"
#include "theme.h"

#include <QFileInfo>
#include <QFileIconProvider>
#include <QFileInfo>
#include <QFrame>
#include <QPointer>
#include <QPushButton>
#include <QFrame>
#include <QRegularExpression>

using namespace std::chrono_literals;
Expand Down Expand Up @@ -76,9 +76,7 @@ ShareDialog::ShareDialog(AccountStatePtr accountState,
closeButton->setAutoDefault(false);

// Set icon
QFileInfo f_info(_localPath);
QFileIconProvider icon_provider;
const QIcon icon = icon_provider.icon(f_info);
const QIcon icon = QFileIconProvider().icon(QFileInfo(_localPath));
if (!icon.isNull()) {
auto pixmap = icon.pixmap(thumbnailSize, thumbnailSize);
_ui->label_icon->setPixmap(pixmap);
Expand Down
30 changes: 12 additions & 18 deletions src/gui/shareusergroupwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,34 @@
*/

#include "shareusergroupwidget.h"
#include "ui_shareusergroupwidget.h"
#include "ui_shareuserline.h"
#include "account.h"
#include "folderman.h"
#include "folder.h"
#include "accountmanager.h"
#include "theme.h"
#include "configfile.h"
#include "capabilities.h"
#include "configfile.h"
#include "guiutility.h"
#include "thumbnailjob.h"
#include "sharee.h"
#include "sharemanager.h"
#include "guiutility.h"
#include "thumbnailjob.h"
#include "ui_shareusergroupwidget.h"
#include "ui_shareuserline.h"

#include "resources/resources.h"

#include "QProgressIndicator.h"

#include <QAbstractProxyModel>
#include <QAction>
#include <QBuffer>
#include <QFileIconProvider>
#include <QClipboard>
#include <QFileInfo>
#include <QAbstractProxyModel>
#include <QColor>
#include <QCompleter>
#include <qscrollarea.h>
#include <qlayout.h>
#include <QPropertyAnimation>
#include <QMenu>
#include <QAction>
#include <QCryptographicHash>
#include <QDesktopServices>
#include <QFileInfo>
#include <QMenu>
#include <QMessageBox>
#include <QCryptographicHash>
#include <QColor>
#include <QPainter>
#include <QPropertyAnimation>

namespace OCC {

Expand Down

0 comments on commit e0b3cf0

Please sign in to comment.