diff --git a/autotests/kfileplacesviewtest.cpp b/autotests/kfileplacesviewtest.cpp --- a/autotests/kfileplacesviewtest.cpp +++ b/autotests/kfileplacesviewtest.cpp @@ -74,28 +74,20 @@ const QDate currentDate = QDate::currentDate(); const QDate yesterdayDate = currentDate.addDays(-1); - const QDate lastMonthDate = currentDate.addMonths(-1); QTest::newRow("Today") << 4 << QStringLiteral("timeline:/today"); QTest::newRow("Yesterday") << 5 << QString("timeline:/%1-%2/%1-%2-%3") .arg(yesterdayDate.year()) .arg(yesterdayDate.month(), 2, 10, QChar('0')) .arg(yesterdayDate.day(), 2, 10, QChar('0')); - QTest::newRow("This Month") << 6 << QString("timeline:/%1-%2") - .arg(currentDate.year()) - .arg(currentDate.month(), 2, 10, QChar('0')); - QTest::newRow("Last Month") << 7 << QString("timeline:/%1-%2") - .arg(lastMonthDate.year()) - .arg(lastMonthDate.month(), 2, 10, QChar('0')); - // search const QString baloonurl = QStringLiteral("baloosearch:?json=%7B%22dayFilter%22: 0, %22monthFilter%22: 0, %22yearFilter%22: 0, %22type%22: [ %22$TYPE$%22]%7D"); const QString typeToReplace = QStringLiteral("$TYPE$"); - QTest::newRow("Documents") << 8 << QString(baloonurl).replace(typeToReplace, QStringLiteral("Document")); - QTest::newRow("Images") << 9 << QString(baloonurl).replace(typeToReplace, QStringLiteral("Image")); - QTest::newRow("Audio Files") << 10 << QString(baloonurl).replace(typeToReplace, QStringLiteral("Audio")); - QTest::newRow("Videos") << 11 << QString(baloonurl).replace(typeToReplace, QStringLiteral("Video")); + QTest::newRow("Documents") << 6 << QString(baloonurl).replace(typeToReplace, QStringLiteral("Document")); + QTest::newRow("Images") << 7 << QString(baloonurl).replace(typeToReplace, QStringLiteral("Image")); + QTest::newRow("Audio Files") << 8 << QString(baloonurl).replace(typeToReplace, QStringLiteral("Audio")); + QTest::newRow("Videos") << 9 << QString(baloonurl).replace(typeToReplace, QStringLiteral("Video")); } void KFilePlacesViewTest::testUrlChanged() diff --git a/src/core/batchrenamejob.h b/src/core/batchrenamejob.h --- a/src/core/batchrenamejob.h +++ b/src/core/batchrenamejob.h @@ -40,7 +40,7 @@ Q_OBJECT public: - virtual ~BatchRenameJob(); + ~BatchRenameJob() Q_DECL_OVERRIDE; Q_SIGNALS: /** diff --git a/src/core/connectionserver.h b/src/core/connectionserver.h --- a/src/core/connectionserver.h +++ b/src/core/connectionserver.h @@ -44,7 +44,7 @@ { Q_OBJECT public: - ConnectionServer(QObject *parent = nullptr); + explicit ConnectionServer(QObject *parent = nullptr); ~ConnectionServer(); /** diff --git a/src/core/copyjob.h b/src/core/copyjob.h --- a/src/core/copyjob.h +++ b/src/core/copyjob.h @@ -74,7 +74,7 @@ */ enum CopyMode { Copy, Move, Link }; - virtual ~CopyJob(); + ~CopyJob() Q_DECL_OVERRIDE; /** * Returns the mode of the operation (copy, move, or link), diff --git a/src/core/dataslave_p.h b/src/core/dataslave_p.h --- a/src/core/dataslave_p.h +++ b/src/core/dataslave_p.h @@ -53,7 +53,7 @@ public: DataSlave(); - virtual ~DataSlave(); + ~DataSlave() Q_DECL_OVERRIDE; virtual void setHost(const QString &host, quint16 port, const QString &user, const QString &passwd) Q_DECL_OVERRIDE; diff --git a/src/core/deletejob.h b/src/core/deletejob.h --- a/src/core/deletejob.h +++ b/src/core/deletejob.h @@ -48,7 +48,7 @@ Q_OBJECT public: - virtual ~DeleteJob(); + ~DeleteJob() Q_DECL_OVERRIDE; /** * Returns the list of URLs. diff --git a/src/core/directorysizejob.h b/src/core/directorysizejob.h --- a/src/core/directorysizejob.h +++ b/src/core/directorysizejob.h @@ -41,7 +41,7 @@ Q_OBJECT public: - ~DirectorySizeJob(); + ~DirectorySizeJob() Q_DECL_OVERRIDE; public: /** diff --git a/src/core/emptytrashjob.h b/src/core/emptytrashjob.h --- a/src/core/emptytrashjob.h +++ b/src/core/emptytrashjob.h @@ -41,7 +41,7 @@ Q_OBJECT public: - ~EmptyTrashJob(); + ~EmptyTrashJob() Q_DECL_OVERRIDE; protected: void slotFinished() Q_DECL_OVERRIDE; diff --git a/src/core/filecopyjob.h b/src/core/filecopyjob.h --- a/src/core/filecopyjob.h +++ b/src/core/filecopyjob.h @@ -40,7 +40,7 @@ Q_OBJECT public: - ~FileCopyJob(); + ~FileCopyJob() Q_DECL_OVERRIDE; /** * If you know the size of the source file, call this method * to inform this job. It will be displayed in the "resume" dialog. diff --git a/src/core/filesystemfreespacejob.h b/src/core/filesystemfreespacejob.h --- a/src/core/filesystemfreespacejob.h +++ b/src/core/filesystemfreespacejob.h @@ -41,7 +41,7 @@ Q_OBJECT public: - ~FileSystemFreeSpaceJob(); + ~FileSystemFreeSpaceJob() Q_DECL_OVERRIDE; Q_SIGNALS: /** diff --git a/src/core/forwardingslavebase.h b/src/core/forwardingslavebase.h --- a/src/core/forwardingslavebase.h +++ b/src/core/forwardingslavebase.h @@ -95,7 +95,7 @@ ForwardingSlaveBase(const QByteArray &protocol, const QByteArray &poolSocket, const QByteArray &appSocket); - virtual ~ForwardingSlaveBase(); + ~ForwardingSlaveBase() Q_DECL_OVERRIDE; void get(const QUrl &url) Q_DECL_OVERRIDE; diff --git a/src/core/hostinfo.cpp b/src/core/hostinfo.cpp --- a/src/core/hostinfo.cpp +++ b/src/core/hostinfo.cpp @@ -211,7 +211,7 @@ start(); } - ~NameLookUpThread() + ~NameLookUpThread() Q_DECL_OVERRIDE { quit(); wait(); diff --git a/src/core/kcoredirlister.h b/src/core/kcoredirlister.h --- a/src/core/kcoredirlister.h +++ b/src/core/kcoredirlister.h @@ -618,12 +618,6 @@ class Private; Private *const d; friend class Private; - - Q_PRIVATE_SLOT(d, void _k_slotInfoMessage(KJob *, const QString &)) - Q_PRIVATE_SLOT(d, void _k_slotPercent(KJob *, unsigned long)) - Q_PRIVATE_SLOT(d, void _k_slotTotalSize(KJob *, qulonglong)) - Q_PRIVATE_SLOT(d, void _k_slotProcessedSize(KJob *, qulonglong)) - Q_PRIVATE_SLOT(d, void _k_slotSpeed(KJob *, unsigned long)) }; Q_DECLARE_OPERATORS_FOR_FLAGS(KCoreDirLister::OpenUrlFlags) diff --git a/src/core/kcoredirlister.cpp b/src/core/kcoredirlister.cpp --- a/src/core/kcoredirlister.cpp +++ b/src/core/kcoredirlister.cpp @@ -58,21 +58,18 @@ { qCDebug(KIO_CORE_DIRLISTER); - connect(&pendingUpdateTimer, SIGNAL(timeout()), this, SLOT(processPendingUpdates())); + connect(&pendingUpdateTimer, &QTimer::timeout, this, &KCoreDirListerCache::processPendingUpdates); pendingUpdateTimer.setSingleShot(true); - connect(KDirWatch::self(), SIGNAL(dirty(QString)), - this, SLOT(slotFileDirty(QString))); - connect(KDirWatch::self(), SIGNAL(created(QString)), - this, SLOT(slotFileCreated(QString))); - connect(KDirWatch::self(), SIGNAL(deleted(QString)), - this, SLOT(slotFileDeleted(QString))); + connect(KDirWatch::self(), &KDirWatch::dirty, this, &KCoreDirListerCache::slotFileDirty); + connect(KDirWatch::self(), &KDirWatch::created, this, &KCoreDirListerCache::slotFileCreated); + connect(KDirWatch::self(), &KDirWatch::deleted, this, &KCoreDirListerCache::slotFileDeleted); kdirnotify = new org::kde::KDirNotify(QString(), QString(), QDBusConnection::sessionBus(), this); connect(kdirnotify, &org::kde::KDirNotify::FileRenamedWithLocalPath, this, &KCoreDirListerCache::slotFileRenamed); - connect(kdirnotify, SIGNAL(FilesAdded(QString)), SLOT(slotFilesAdded(QString))); - connect(kdirnotify, SIGNAL(FilesChanged(QStringList)), SLOT(slotFilesChanged(QStringList))); - connect(kdirnotify, SIGNAL(FilesRemoved(QStringList)), SLOT(slotFilesRemoved(QStringList))); + connect(kdirnotify, &org::kde::KDirNotify::FilesAdded , this, &KCoreDirListerCache::slotFilesAdded); + connect(kdirnotify, &org::kde::KDirNotify::FilesChanged, this, &KCoreDirListerCache::slotFilesChanged); + connect(kdirnotify, &org::kde::KDirNotify::FilesRemoved, this, QOverload::of(&KCoreDirListerCache::slotFilesRemoved)); // Probably not needed in KF5 anymore: // The use of KUrl::url() in ~DirItem (sendSignal) crashes if the static for QRegExpEngine got deleted already, @@ -238,12 +235,9 @@ lister->jobStarted(job); lister->d->connectJob(job); - connect(job, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), - this, SLOT(slotEntries(KIO::Job*,KIO::UDSEntryList))); - connect(job, SIGNAL(result(KJob*)), - this, SLOT(slotResult(KJob*))); - connect(job, SIGNAL(redirection(KIO::Job*,QUrl)), - this, SLOT(slotRedirection(KIO::Job*,QUrl))); + connect(job, &KIO::ListJob::entries, this, &KCoreDirListerCache::slotEntries); + connect(job, &KJob::result, this, &KCoreDirListerCache::slotResult); + connect(job, &KIO::ListJob::redirection, this, &KCoreDirListerCache::slotRedirection); emit lister->started(_url); } @@ -723,10 +717,8 @@ job = KIO::listDir(dir, KIO::HideProgressInfo); runningListJobs.insert(job, KIO::UDSEntryList()); - connect(job, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), - this, SLOT(slotUpdateEntries(KIO::Job*,KIO::UDSEntryList))); - connect(job, SIGNAL(result(KJob*)), - this, SLOT(slotUpdateResult(KJob*))); + connect(job, &KIO::ListJob::entries, this, &KCoreDirListerCache::slotUpdateEntries); + connect(job, &KJob::result, this, &KCoreDirListerCache::slotUpdateResult); qCDebug(KIO_CORE_DIRLISTER) << "update started in" << dir; @@ -1544,10 +1536,8 @@ // make the job an update job job->disconnect(this); - connect(job, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), - this, SLOT(slotUpdateEntries(KIO::Job*,KIO::UDSEntryList))); - connect(job, SIGNAL(result(KJob*)), - this, SLOT(slotUpdateResult(KJob*))); + connect(job, &KIO::ListJob::entries, this, &KCoreDirListerCache::slotUpdateEntries); + connect(job, &KJob::result, this, &KCoreDirListerCache::slotUpdateResult); // FIXME: autoUpdate-Counts!! @@ -2726,16 +2716,16 @@ void KCoreDirLister::Private::connectJob(KIO::ListJob *job) { - m_parent->connect(job, SIGNAL(infoMessage(KJob*,QString,QString)), - m_parent, SLOT(_k_slotInfoMessage(KJob*,QString))); - m_parent->connect(job, SIGNAL(percent(KJob*,ulong)), - m_parent, SLOT(_k_slotPercent(KJob*,ulong))); - m_parent->connect(job, SIGNAL(totalSize(KJob*,qulonglong)), - m_parent, SLOT(_k_slotTotalSize(KJob*,qulonglong))); - m_parent->connect(job, SIGNAL(processedSize(KJob*,qulonglong)), - m_parent, SLOT(_k_slotProcessedSize(KJob*,qulonglong))); - m_parent->connect(job, SIGNAL(speed(KJob*,ulong)), - m_parent, SLOT(_k_slotSpeed(KJob*,ulong))); + m_parent->connect(job, &KJob::infoMessage, m_parent, + [this](KJob *job, const QString &plain){ _k_slotInfoMessage(job, plain); }); + m_parent->connect(job, QOverload::of(&KJob::percent), m_parent, + [this](KJob *job, ulong _percent){ _k_slotPercent(job, _percent); }); + m_parent->connect(job, &KJob::totalSize, m_parent, + [this](KJob *job, qulonglong _size){ _k_slotTotalSize(job, _size); }); + m_parent->connect(job, &KJob::processedSize, m_parent, + [this](KJob *job, qulonglong _psize){ _k_slotProcessedSize(job, _psize); }); + m_parent->connect(job, &KJob::speed, m_parent, + [this](KJob *job, qulonglong _speed){ _k_slotSpeed(job, _speed); }); } KFileItemList KCoreDirLister::items(WhichItems which) const diff --git a/src/core/krecentdocument.cpp b/src/core/krecentdocument.cpp --- a/src/core/krecentdocument.cpp +++ b/src/core/krecentdocument.cpp @@ -86,7 +86,12 @@ void KRecentDocument::add(const QUrl &url) { - KRecentDocument::add(url, QCoreApplication::applicationName()); + // desktopFileName is in QGuiApplication but we're in KIO Core here + QString desktopEntryName = QCoreApplication::instance()->property("desktopFileName").toString(); + if (desktopEntryName.isEmpty()) { + desktopEntryName = QCoreApplication::applicationName(); + } + KRecentDocument::add(url, desktopEntryName); // ### componentName might not match the service filename... } @@ -143,7 +148,8 @@ it = list.begin(); while (i > maxEntries - 1) { QFile::remove(dir.absolutePath() + QLatin1String("/") + (*it)); - --i, ++it; + --i; + ++it; } } diff --git a/src/core/listjob.h b/src/core/listjob.h --- a/src/core/listjob.h +++ b/src/core/listjob.h @@ -42,7 +42,7 @@ Q_OBJECT public: - ~ListJob(); + ~ListJob() Q_DECL_OVERRIDE; /** * Returns the ListJob's redirection URL. This will be invalid if there diff --git a/src/core/mimetypejob.h b/src/core/mimetypejob.h --- a/src/core/mimetypejob.h +++ b/src/core/mimetypejob.h @@ -41,7 +41,7 @@ Q_OBJECT public: - ~MimetypeJob(); + ~MimetypeJob() Q_DECL_OVERRIDE; protected Q_SLOTS: void slotFinished() Q_DECL_OVERRIDE; diff --git a/src/core/mkdirjob.h b/src/core/mkdirjob.h --- a/src/core/mkdirjob.h +++ b/src/core/mkdirjob.h @@ -40,7 +40,7 @@ Q_OBJECT public: - ~MkdirJob(); + ~MkdirJob() Q_DECL_OVERRIDE; Q_SIGNALS: /** diff --git a/src/core/mkpathjob.h b/src/core/mkpathjob.h --- a/src/core/mkpathjob.h +++ b/src/core/mkpathjob.h @@ -44,7 +44,7 @@ Q_OBJECT public: - virtual ~MkpathJob(); + ~MkpathJob() Q_DECL_OVERRIDE; Q_SIGNALS: /** diff --git a/src/core/mkpathjob.cpp b/src/core/mkpathjob.cpp --- a/src/core/mkpathjob.cpp +++ b/src/core/mkpathjob.cpp @@ -36,7 +36,7 @@ MkpathJobPrivate(const QUrl &url, const QUrl &baseUrl, JobFlags flags) : JobPrivate(), m_url(url), - m_pathComponents(url.path().split('/', QString::SkipEmptyParts)), + m_pathComponents(url.path().split(QLatin1Char('/'), QString::SkipEmptyParts)), m_pathIterator(), m_flags(flags) { diff --git a/src/core/multigetjob.h b/src/core/multigetjob.h --- a/src/core/multigetjob.h +++ b/src/core/multigetjob.h @@ -40,7 +40,7 @@ Q_OBJECT public: - virtual ~MultiGetJob(); + ~MultiGetJob() Q_DECL_OVERRIDE; /** * Get an additional file. diff --git a/src/core/restorejob.h b/src/core/restorejob.h --- a/src/core/restorejob.h +++ b/src/core/restorejob.h @@ -45,7 +45,7 @@ Q_OBJECT public: - virtual ~RestoreJob(); + ~RestoreJob() Q_DECL_OVERRIDE; /** * Returns the list of trash URLs to restore. diff --git a/src/core/scheduler.cpp b/src/core/scheduler.cpp --- a/src/core/scheduler.cpp +++ b/src/core/scheduler.cpp @@ -982,8 +982,11 @@ void SchedulerPrivate::setJobPriority(SimpleJob *job, int priority) { //qDebug() << job << priority; - ProtoQueue *proto = protoQ(SimpleJobPrivate::get(job)->m_protocol, job->url().host()); - proto->changeJobPriority(job, priority); + const QString protocol = SimpleJobPrivate::get(job)->m_protocol; + if (!protocol.isEmpty()) { + ProtoQueue *proto = protoQ(SimpleJobPrivate::get(job)->m_protocol, job->url().host()); + proto->changeJobPriority(job, priority); + } } void SchedulerPrivate::cancelJob(SimpleJob *job) diff --git a/src/core/simplejob.h b/src/core/simplejob.h --- a/src/core/simplejob.h +++ b/src/core/simplejob.h @@ -41,7 +41,7 @@ Q_OBJECT public: - ~SimpleJob(); + ~SimpleJob() Q_DECL_OVERRIDE; protected: /** diff --git a/src/core/statjob.h b/src/core/statjob.h --- a/src/core/statjob.h +++ b/src/core/statjob.h @@ -45,7 +45,7 @@ DestinationSide }; - ~StatJob(); + ~StatJob() Q_DECL_OVERRIDE; /** * A stat() can have two meanings. Either we want to read from this URL, diff --git a/src/core/tcpslavebase.h b/src/core/tcpslavebase.h --- a/src/core/tcpslavebase.h +++ b/src/core/tcpslavebase.h @@ -61,7 +61,7 @@ const QByteArray &poolSocket, const QByteArray &appSocket, bool autoSsl = false); - virtual ~TCPSlaveBase(); + ~TCPSlaveBase() Q_DECL_OVERRIDE; protected: enum SslResultDetail { diff --git a/src/core/transferjob.h b/src/core/transferjob.h --- a/src/core/transferjob.h +++ b/src/core/transferjob.h @@ -40,7 +40,7 @@ Q_OBJECT public: - ~TransferJob(); + ~TransferJob() Q_DECL_OVERRIDE; /** * Sets the modification time of the file to be created (by KIO::put) diff --git a/src/filewidgets/kdiroperator.cpp b/src/filewidgets/kdiroperator.cpp --- a/src/filewidgets/kdiroperator.cpp +++ b/src/filewidgets/kdiroperator.cpp @@ -229,6 +229,7 @@ void _k_slotDirectoryCreated(const QUrl &); void updateListViewGrid(); + void updatePreviewActionState(); int iconSizeForViewType(QAbstractItemView *itemView) const; // private members @@ -282,6 +283,9 @@ KFilePreviewGenerator *previewGenerator; bool showPreviews; + bool calledFromUpdatePreviewActionState; + bool showPreviewsConfigEntry; + int iconsZoom; bool isSaving; @@ -316,6 +320,8 @@ configGroup(nullptr), previewGenerator(nullptr), showPreviews(false), + calledFromUpdatePreviewActionState(false), + showPreviewsConfigEntry(false), iconsZoom(0), isSaving(false), decorationMenu(nullptr), @@ -654,6 +660,10 @@ showPreviews = show; + if (!calledFromUpdatePreviewActionState) { + showPreviewsConfigEntry = show; + } + if (!previewGenerator) { return; } @@ -1883,22 +1893,23 @@ connect(action, SIGNAL(triggered(bool)), this, SLOT(deleteSelected())); // the sort menu actions - KActionMenu *sortMenu = new KActionMenu(i18n("Sorting"), this); + KActionMenu *sortMenu = new KActionMenu(i18n("Sort by"), this); d->actionCollection->addAction(QStringLiteral("sorting menu"), sortMenu); + sortMenu->setIcon(QIcon::fromTheme(QStringLiteral("itemize"))); - KToggleAction *byNameAction = new KToggleAction(i18n("By Name"), this); + KToggleAction *byNameAction = new KToggleAction(i18n("Name"), this); d->actionCollection->addAction(QStringLiteral("by name"), byNameAction); connect(byNameAction, SIGNAL(triggered(bool)), this, SLOT(_k_slotSortByName())); - KToggleAction *bySizeAction = new KToggleAction(i18n("By Size"), this); + KToggleAction *bySizeAction = new KToggleAction(i18n("Size"), this); d->actionCollection->addAction(QStringLiteral("by size"), bySizeAction); connect(bySizeAction, SIGNAL(triggered(bool)), this, SLOT(_k_slotSortBySize())); - KToggleAction *byDateAction = new KToggleAction(i18n("By Date"), this); + KToggleAction *byDateAction = new KToggleAction(i18n("Date"), this); d->actionCollection->addAction(QStringLiteral("by date"), byDateAction); connect(byDateAction, SIGNAL(triggered(bool)), this, SLOT(_k_slotSortByDate())); - KToggleAction *byTypeAction = new KToggleAction(i18n("By Type"), this); + KToggleAction *byTypeAction = new KToggleAction(i18n("Type"), this); d->actionCollection->addAction(QStringLiteral("by type"), byTypeAction); connect(byTypeAction, SIGNAL(triggered(bool)), this, SLOT(_k_slotSortByType())); @@ -2060,6 +2071,7 @@ if (whichActions & ViewActions) { d->actionMenu->addAction(d->actionCollection->action(QStringLiteral("view menu"))); + d->actionMenu->addAction(d->actionCollection->action(QStringLiteral("reload"))); d->actionMenu->addSeparator(); } @@ -2150,6 +2162,7 @@ if (d->inlinePreviewState == Private::NotForced) { d->showPreviews = configGroup.readEntry(QStringLiteral("Previews"), false); + d->showPreviewsConfigEntry = d->showPreviews; } QStyleOptionViewItem::Position pos = (QStyleOptionViewItem::Position) configGroup.readEntry(QStringLiteral("Decoration position"), (int) QStyleOptionViewItem::Left); setDecorationPosition(pos); @@ -2213,7 +2226,7 @@ configGroup.writeEntry(QStringLiteral("View Style"), style); if (d->inlinePreviewState == Private::NotForced) { - configGroup.writeEntry(QStringLiteral("Previews"), d->showPreviews); + configGroup.writeEntry(QStringLiteral("Previews"), d->showPreviewsConfigEntry); if (qobject_cast(d->itemView)) { configGroup.writeEntry(QStringLiteral("listViewIconSize"), d->iconsZoom); } else { @@ -2249,6 +2262,8 @@ // might be reparented into a statusbar d->progressBar->move(2, height() - d->progressBar->height() - 2); } + + d->updateListViewGrid(); } void KDirOperator::setOnlyDoubleClickSelectsFiles(bool enable) @@ -2561,12 +2576,39 @@ completeListDirty = true; } +void KDirOperator::Private::updatePreviewActionState() +{ + if (!itemView) { + return; + } + + const QFontMetrics metrics(itemView->viewport()->font()); + + // hide icon previews when they are too small + const bool iconSizeBigEnoughForPreview = itemView->iconSize().height() > metrics.height() * 2; + + KToggleAction *previewAction = qobject_cast(actionCollection->action(QStringLiteral("inline preview"))); + previewAction->setEnabled(iconSizeBigEnoughForPreview); + + if (iconSizeBigEnoughForPreview) { + previewAction->setToolTip(i18n("Show Preview")); + } else { + previewAction->setToolTip(i18n("Automatically disabled for small icon sizes; increase icon size to see previews")); + } + + calledFromUpdatePreviewActionState = true; + previewAction->setChecked(iconSizeBigEnoughForPreview && showPreviewsConfigEntry); + calledFromUpdatePreviewActionState = false; +} + void KDirOperator::Private::updateListViewGrid() { if (!itemView) { return; } + updatePreviewActionState(); + QListView *view = qobject_cast(itemView); if (!view) { @@ -2583,12 +2625,26 @@ } } else { const QFontMetrics metrics(itemView->viewport()->font()); - int size = itemView->iconSize().height() + metrics.height() * 2; - // some heuristics for good looking. let's guess width = height * (3 / 2) is nice - view->setGridSize(QSize(size * (3.0 / 2.0), size + metrics.height())); + + const int height = itemView->iconSize().height() + metrics.height() * 2.5; + const int minWidth = qMax(height, metrics.height() * 5); + + const int scrollBarWidth = itemView->verticalScrollBar()->sizeHint().width(); + + // Subtract 1 px to prevent flickering when resizing the window + // For Oxygen a column is missing after showing the dialog without resizing it, + // therefore subtract 4 more (scaled) pixels + const int viewPortWidth = itemView->contentsRect().width() - scrollBarWidth - 1 - 4 * itemView->devicePixelRatioF(); + const int itemsInRow = qMax(1, viewPortWidth / minWidth); + const int remainingWidth = viewPortWidth - (minWidth * itemsInRow); + const int width = minWidth + (remainingWidth / itemsInRow); + + const QSize itemSize(width, height); + + view->setGridSize(itemSize); KFileItemDelegate *delegate = qobject_cast(view->itemDelegate()); if (delegate) { - delegate->setMaximumSize(QSize(size * (3.0 / 2.0), size + metrics.height())); + delegate->setMaximumSize(itemSize); } } } diff --git a/src/filewidgets/kdirsortfilterproxymodel.h b/src/filewidgets/kdirsortfilterproxymodel.h --- a/src/filewidgets/kdirsortfilterproxymodel.h +++ b/src/filewidgets/kdirsortfilterproxymodel.h @@ -55,8 +55,8 @@ Q_OBJECT public: - KDirSortFilterProxyModel(QObject *parent = nullptr); - virtual ~KDirSortFilterProxyModel(); + explicit KDirSortFilterProxyModel(QObject *parent = nullptr); + ~KDirSortFilterProxyModel() Q_DECL_OVERRIDE; /** Reimplemented from QAbstractItemModel. Returns true for directories. */ bool hasChildren(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; diff --git a/src/filewidgets/kfilebookmarkhandler_p.h b/src/filewidgets/kfilebookmarkhandler_p.h --- a/src/filewidgets/kfilebookmarkhandler_p.h +++ b/src/filewidgets/kfilebookmarkhandler_p.h @@ -33,8 +33,8 @@ Q_OBJECT public: - KFileBookmarkHandler(KFileWidget *widget); - ~KFileBookmarkHandler(); + explicit KFileBookmarkHandler(KFileWidget *widget); + ~KFileBookmarkHandler() Q_DECL_OVERRIDE; QMenu *popupMenu(); diff --git a/src/filewidgets/kfilecopytomenu.h b/src/filewidgets/kfilecopytomenu.h --- a/src/filewidgets/kfilecopytomenu.h +++ b/src/filewidgets/kfilecopytomenu.h @@ -45,7 +45,7 @@ * @param parentWidget parent widget for the file dialog and message boxes. * The parentWidget also serves as a parent for this object. */ - KFileCopyToMenu(QWidget *parentWidget); + explicit KFileCopyToMenu(QWidget *parentWidget); /** * Destructor diff --git a/src/filewidgets/kfilecustomdialog.h b/src/filewidgets/kfilecustomdialog.h --- a/src/filewidgets/kfilecustomdialog.h +++ b/src/filewidgets/kfilecustomdialog.h @@ -37,7 +37,7 @@ Q_OBJECT public: explicit KFileCustomDialog(QWidget *parent = nullptr); - ~KFileCustomDialog(); + ~KFileCustomDialog() Q_DECL_OVERRIDE; /** * Sets the directory to view. diff --git a/src/filewidgets/kfilefiltercombo.h b/src/filewidgets/kfilefiltercombo.h --- a/src/filewidgets/kfilefiltercombo.h +++ b/src/filewidgets/kfilefiltercombo.h @@ -41,12 +41,12 @@ * * @param parent The parent widget. */ - KFileFilterCombo(QWidget *parent = nullptr); + explicit KFileFilterCombo(QWidget *parent = nullptr); /** * Destroys the filter combo box. */ - ~KFileFilterCombo(); + ~KFileFilterCombo() Q_DECL_OVERRIDE; /** * Sets the @p filter string. diff --git a/src/filewidgets/kfileplacesmodel.h b/src/filewidgets/kfileplacesmodel.h --- a/src/filewidgets/kfileplacesmodel.h +++ b/src/filewidgets/kfileplacesmodel.h @@ -65,16 +65,16 @@ UnknownType }; - KFilePlacesModel(QObject *parent = nullptr); + explicit KFilePlacesModel(QObject *parent = nullptr); /** * @brief Construct a new KFilePlacesModel with an alternativeApplicationName * @param alternativeApplicationName This value will be used to filter bookmarks in addition to the actual application name * @param parent Parent object * @since 5.43 * @todo kf6: merge contstructors */ KFilePlacesModel(const QString &alternativeApplicationName, QObject *parent = nullptr); - ~KFilePlacesModel(); + ~KFilePlacesModel() Q_DECL_OVERRIDE; QUrl url(const QModelIndex &index) const; bool setupNeeded(const QModelIndex &index) const; diff --git a/src/filewidgets/kfileplacesmodel.cpp b/src/filewidgets/kfileplacesmodel.cpp --- a/src/filewidgets/kfileplacesmodel.cpp +++ b/src/filewidgets/kfileplacesmodel.cpp @@ -239,6 +239,22 @@ KFilePlacesItem::createSystemBookmark(d->bookmarkManager, QStringLiteral("Home"), I18N_NOOP2("KFile System Bookmarks", "Home"), QUrl::fromLocalFile(QDir::homePath()), QStringLiteral("user-home")); + + // Some distros may not create various standard XDG folders by default + // so check for their existance before adding bookmarks for them + const QString desktopFolder = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); + if (QDir(desktopFolder).exists()) { + KFilePlacesItem::createSystemBookmark(d->bookmarkManager, + QStringLiteral("Desktop"), I18N_NOOP2("KFile System Bookmarks", "Desktop"), + QUrl::fromLocalFile(desktopFolder), QStringLiteral("user-desktop")); + } + const QString downloadFolder = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation); + if (QDir(downloadFolder).exists()) { + KFilePlacesItem::createSystemBookmark(d->bookmarkManager, + QStringLiteral("Downloads"), I18N_NOOP2("KFile System Bookmarks", "Downloads"), + QUrl::fromLocalFile(downloadFolder), QStringLiteral("folder-downloads")); + } + KFilePlacesItem::createSystemBookmark(d->bookmarkManager, QStringLiteral("Network"), I18N_NOOP2("KFile System Bookmarks", "Network"), QUrl(QStringLiteral("remote:/")), QStringLiteral("network-workgroup")); diff --git a/src/filewidgets/kfileplacesview.h b/src/filewidgets/kfileplacesview.h --- a/src/filewidgets/kfileplacesview.h +++ b/src/filewidgets/kfileplacesview.h @@ -37,8 +37,8 @@ { Q_OBJECT public: - KFilePlacesView(QWidget *parent = nullptr); - ~KFilePlacesView(); + explicit KFilePlacesView(QWidget *parent = nullptr); + ~KFilePlacesView() Q_DECL_OVERRIDE; /** * If \a enabled is true, it is allowed dropping items diff --git a/src/filewidgets/kfileplacesview.cpp b/src/filewidgets/kfileplacesview.cpp --- a/src/filewidgets/kfileplacesview.cpp +++ b/src/filewidgets/kfileplacesview.cpp @@ -59,8 +59,8 @@ { Q_OBJECT public: - KFilePlacesViewDelegate(KFilePlacesView *parent); - virtual ~KFilePlacesViewDelegate(); + explicit KFilePlacesViewDelegate(KFilePlacesView *parent); + ~KFilePlacesViewDelegate() Q_DECL_OVERRIDE; QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE; void paint(QPainter *painter, diff --git a/src/filewidgets/kfilepreviewgenerator.cpp b/src/filewidgets/kfilepreviewgenerator.cpp --- a/src/filewidgets/kfilepreviewgenerator.cpp +++ b/src/filewidgets/kfilepreviewgenerator.cpp @@ -490,7 +490,7 @@ connect(m_changedItemsTimer, SIGNAL(timeout()), q, SLOT(delayedIconUpdate())); - KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings"); + KConfigGroup globalConfig(KSharedConfig::openConfig("dolphinrc"), "PreviewSettings"); m_enabledPlugins = globalConfig.readEntry("Plugins", QStringList() << QStringLiteral("directorythumbnail") << QStringLiteral("imagethumbnail") diff --git a/src/filewidgets/kfilewidget.h b/src/filewidgets/kfilewidget.h --- a/src/filewidgets/kfilewidget.h +++ b/src/filewidgets/kfilewidget.h @@ -93,7 +93,7 @@ /** * Destructor */ - virtual ~KFileWidget(); + ~KFileWidget() Q_DECL_OVERRIDE; /** * Defines some default behavior of the filedialog. diff --git a/src/filewidgets/kfilewidget.cpp b/src/filewidgets/kfilewidget.cpp --- a/src/filewidgets/kfilewidget.cpp +++ b/src/filewidgets/kfilewidget.cpp @@ -104,7 +104,9 @@ dummyAdded(false), confirmOverwrite(false), differentHierarchyLevelItemsEntered(false), - iconSizeSlider(nullptr) + iconSizeSlider(nullptr), + zoomOutAction(nullptr), + zoomInAction(nullptr) { } @@ -117,6 +119,8 @@ void updateLocationWhatsThis(); void updateAutoSelectExtension(); void initSpeedbar(); + void setPlacesViewSplitterSizes(); + void setLafBoxColumnWidth(); void initGUI(); void readViewConfig(); void writeViewConfig(); @@ -284,6 +288,8 @@ bool differentHierarchyLevelItemsEntered; QSlider *iconSizeSlider; + QAction *zoomOutAction; + QAction *zoomInAction; // The group which stores app-specific settings. These settings are recent // files and urls. Visual settings (view mode, sorting criteria...) are not @@ -486,7 +492,6 @@ "
  • the Places navigation panel
  • " "
  • file previews
  • " "
  • separating folders from files
  • ")); - menu->addAction(coll->action(QStringLiteral("sorting menu"))); menu->addAction(coll->action(QStringLiteral("view menu"))); menu->addSeparator(); menu->addAction(coll->action(QStringLiteral("decoration menu"))); @@ -503,6 +508,7 @@ d->iconSizeSlider = new QSlider(this); d->iconSizeSlider->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed); + d->iconSizeSlider->setMinimumWidth(40); d->iconSizeSlider->setOrientation(Qt::Horizontal); d->iconSizeSlider->setMinimum(0); d->iconSizeSlider->setMaximum(100); @@ -513,16 +519,19 @@ this, SLOT(_k_slotIconSizeChanged(int))); connect(d->iconSizeSlider, SIGNAL(sliderMoved(int)), this, SLOT(_k_slotIconSizeSliderMoved(int))); - connect(d->ops, SIGNAL(currentIconSizeChanged(int)), - d->iconSizeSlider, SLOT(setValue(int))); + connect(d->ops, &KDirOperator::currentIconSizeChanged, [this](int value) { + d->iconSizeSlider->setValue(value); + d->zoomOutAction->setDisabled(value <= d->iconSizeSlider->minimum()); + d->zoomInAction->setDisabled(value >= d->iconSizeSlider->maximum()); + }); - QAction *furtherAction = new QAction(QIcon::fromTheme(QStringLiteral("file-zoom-out")), i18n("Zoom out"), this); - connect(furtherAction, SIGNAL(triggered()), SLOT(_k_zoomOutIconsSize())); - QAction *closerAction = new QAction(QIcon::fromTheme(QStringLiteral("file-zoom-in")), i18n("Zoom in"), this); - connect(closerAction, SIGNAL(triggered()), SLOT(_k_zoomInIconsSize())); + d->zoomOutAction = new QAction(QIcon::fromTheme(QStringLiteral("file-zoom-out")), i18n("Zoom out"), this); + connect(d->zoomOutAction, SIGNAL(triggered()), SLOT(_k_zoomOutIconsSize())); + d->zoomInAction = new QAction(QIcon::fromTheme(QStringLiteral("file-zoom-in")), i18n("Zoom in"), this); + connect(d->zoomInAction, SIGNAL(triggered()), SLOT(_k_zoomInIconsSize())); QWidget *midSpacer = new QWidget(this); - midSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + midSpacer1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); QAction *separator = new QAction(this); separator->setSeparator(true); @@ -542,10 +551,11 @@ d->toolbar->addAction(coll->action(QStringLiteral("detailed tree view"))); d->toolbar->addAction(separator2); d->toolbar->addAction(coll->action(QStringLiteral("inline preview"))); + d->toolbar->addAction(coll->action(QStringLiteral("sorting menu"))); d->toolbar->addWidget(midSpacer); - d->toolbar->addAction(furtherAction); + d->toolbar->addAction(d->zoomOutAction); d->toolbar->addWidget(d->iconSizeSlider); - d->toolbar->addAction(closerAction); + d->toolbar->addAction(d->zoomInAction); d->toolbar->addAction(separator3); d->toolbar->addAction(coll->action(QStringLiteral("mkdir"))); d->toolbar->addAction(menu); @@ -1153,7 +1163,6 @@ } locationEdit->lineEdit()->setModified(false); - locationEdit->lineEdit()->selectAll(); } void KFileWidgetPrivate::_k_fileSelected(const KFileItem &i) @@ -1288,8 +1297,7 @@ removeDummyHistoryEntry(); } - // don't change selection when user has clicked on an item - if (operationMode == KFileWidget::Saving && !locationEdit->isVisible()) { + if (operationMode == KFileWidget::Saving) { setNonExtSelection(); } } @@ -1328,8 +1336,7 @@ removeDummyHistoryEntry(); } - // don't change selection when user has clicked on an item - if (operationMode == KFileWidget::Saving && !locationEdit->isVisible()) { + if (operationMode == KFileWidget::Saving) { setNonExtSelection(); } } @@ -1384,15 +1391,30 @@ // initialize the size of the splitter placesViewWidth = configGroup.readEntry(SpeedbarWidth, placesView->sizeHint().width()); - QList sizes = placesViewSplitter->sizes(); + // Needed for when the dialog is shown with the places panel initially hidden + setPlacesViewSplitterSizes(); + + QObject::connect(placesDock, SIGNAL(visibilityChanged(bool)), + q, SLOT(_k_toggleSpeedbar(bool))); +} + +void KFileWidgetPrivate::setPlacesViewSplitterSizes() +{ if (placesViewWidth > 0) { - sizes[0] = placesViewWidth + 1; - sizes[1] = q->width() - placesViewWidth - 1; + QList sizes = placesViewSplitter->sizes(); + sizes[0] = placesViewWidth; + sizes[1] = q->width() - placesViewWidth - placesViewSplitter->handleWidth(); placesViewSplitter->setSizes(sizes); } +} - QObject::connect(placesDock, SIGNAL(visibilityChanged(bool)), - q, SLOT(_k_toggleSpeedbar(bool))); +void KFileWidgetPrivate::setLafBoxColumnWidth() +{ + // In order to perfectly align the filename widget with KDirOperator's icon view + // - placesViewWidth needs to account for the size of the splitter handle + // - the lafBox grid layout spacing should only affect the label, but not the line edit + const int adjustment = placesViewSplitter->handleWidth() - lafBox->horizontalSpacing(); + lafBox->setColumnMinimumWidth(0, placesViewWidth + adjustment); } void KFileWidgetPrivate::initGUI() @@ -1830,10 +1852,7 @@ if (d->placesDock) { // we don't want our places dock actually changing size when we resize // and qt doesn't make it easy to enforce such a thing with QSplitter - QList sizes = d->placesViewSplitter->sizes(); - sizes[0] = d->placesViewWidth + 1; // without this pixel, our places view is reduced 1 pixel each time is shown. - sizes[1] = width() - d->placesViewWidth - 1; - d->placesViewSplitter->setSizes(sizes); + d->setPlacesViewSplitterSizes(); } } @@ -1964,10 +1983,8 @@ const bool showSpeedbar = placesDock && !placesDock->isHidden(); tmpGroup.writeEntry(ShowSpeedbar, showSpeedbar); - if (showSpeedbar) { - const QList sizes = placesViewSplitter->sizes(); - Q_ASSERT(sizes.count() > 0); - tmpGroup.writeEntry(SpeedbarWidth, sizes[0]); + if (placesViewWidth > 0) { + tmpGroup.writeEntry(SpeedbarWidth, placesViewWidth); } tmpGroup.writeEntry(ShowBookmarks, bookmarkHandler != nullptr); @@ -2098,7 +2115,7 @@ if (placesDock && index == 1) { placesViewWidth = pos; // qDebug() << "setting lafBox minwidth to" << placesViewWidth; - lafBox->setColumnMinimumWidth(0, placesViewWidth); + setLafBoxColumnWidth(); } } @@ -2553,7 +2570,7 @@ if (show) { initSpeedbar(); placesDock->show(); - lafBox->setColumnMinimumWidth(0, placesViewWidth); + setLafBoxColumnWidth(); // check to see if they have a home item defined, if not show the home button QUrl homeURL; @@ -2739,6 +2756,8 @@ int lastDot = filename.lastIndexOf('.'); if (lastDot > 0) { locationEdit->lineEdit()->setSelection(0, lastDot); + } else { + locationEdit->lineEdit()->selectAll(); } } } @@ -2857,6 +2876,7 @@ { d->model->setSupportedSchemes(schemes); d->ops->setSupportedSchemes(schemes); + d->urlNavigator->setCustomProtocols(schemes); } QStringList KFileWidget::supportedSchemes() const diff --git a/src/filewidgets/kimagefilepreview.h b/src/filewidgets/kimagefilepreview.h --- a/src/filewidgets/kimagefilepreview.h +++ b/src/filewidgets/kimagefilepreview.h @@ -43,7 +43,7 @@ /** * Destroys the image file preview. */ - ~KImageFilePreview(); + ~KImageFilePreview() Q_DECL_OVERRIDE; /** * Returns the size hint for this widget. diff --git a/src/filewidgets/kpreviewwidgetbase.h b/src/filewidgets/kpreviewwidgetbase.h --- a/src/filewidgets/kpreviewwidgetbase.h +++ b/src/filewidgets/kpreviewwidgetbase.h @@ -54,7 +54,7 @@ * * @param parent The KFileDialog this preview widget is going to be used in */ - KPreviewWidgetBase(QWidget *parent); + explicit KPreviewWidgetBase(QWidget *parent); ~KPreviewWidgetBase(); public Q_SLOTS: diff --git a/src/filewidgets/kurlnavigator.h b/src/filewidgets/kurlnavigator.h --- a/src/filewidgets/kurlnavigator.h +++ b/src/filewidgets/kurlnavigator.h @@ -270,8 +270,7 @@ * If an application supports only some special protocols, they can be set * with \a protocols . */ - // KDE5: Think about removing the custom-protocols-property. It had been used - // only by one application currently which uses a different approach now. + // TODO KF6 rename to setSupportedSchemes to match KDirOperator and KFileWidget void setCustomProtocols(const QStringList &protocols); /** diff --git a/src/filewidgets/kurlnavigator.cpp b/src/filewidgets/kurlnavigator.cpp --- a/src/filewidgets/kurlnavigator.cpp +++ b/src/filewidgets/kurlnavigator.cpp @@ -518,7 +518,9 @@ if (text.isEmpty()) { const QString protocol = q->locationUrl().scheme(); m_protocols->setProtocol(protocol); - m_protocols->show(); + if (m_customProtocols.count() != 1) { + m_protocols->show(); + } } else { m_protocols->hide(); } diff --git a/src/filewidgets/kurlnavigatorbutton.cpp b/src/filewidgets/kurlnavigatorbutton.cpp --- a/src/filewidgets/kurlnavigatorbutton.cpp +++ b/src/filewidgets/kurlnavigatorbutton.cpp @@ -80,7 +80,8 @@ static const QSet protocolBlacklist = QSet() << QStringLiteral("nfs") << QStringLiteral("fish") << QStringLiteral("ftp") << QStringLiteral("sftp") - << QStringLiteral("smb") << QStringLiteral("webdav"); + << QStringLiteral("smb") << QStringLiteral("webdav") + << QStringLiteral("mtp"); const bool startTextResolving = m_url.isValid() && !m_url.isLocalFile() && !protocolBlacklist.contains(m_url.scheme()); diff --git a/src/filewidgets/kurlnavigatordropdownbutton_p.h b/src/filewidgets/kurlnavigatordropdownbutton_p.h --- a/src/filewidgets/kurlnavigatordropdownbutton_p.h +++ b/src/filewidgets/kurlnavigatordropdownbutton_p.h @@ -38,7 +38,7 @@ public: explicit KUrlNavigatorDropDownButton(QWidget *parent); - virtual ~KUrlNavigatorDropDownButton(); + ~KUrlNavigatorDropDownButton() Q_DECL_OVERRIDE; /** @see QWidget::sizeHint() */ QSize sizeHint() const Q_DECL_OVERRIDE; diff --git a/src/filewidgets/kurlnavigatormenu_p.h b/src/filewidgets/kurlnavigatormenu_p.h --- a/src/filewidgets/kurlnavigatormenu_p.h +++ b/src/filewidgets/kurlnavigatormenu_p.h @@ -39,7 +39,7 @@ public: explicit KUrlNavigatorMenu(QWidget *parent); - virtual ~KUrlNavigatorMenu(); + ~KUrlNavigatorMenu() Q_DECL_OVERRIDE; Q_SIGNALS: /** diff --git a/src/filewidgets/kurlnavigatorplacesselector_p.h b/src/filewidgets/kurlnavigatorplacesselector_p.h --- a/src/filewidgets/kurlnavigatorplacesselector_p.h +++ b/src/filewidgets/kurlnavigatorplacesselector_p.h @@ -52,7 +52,7 @@ */ KUrlNavigatorPlacesSelector(QWidget *parent, KFilePlacesModel *placesModel); - virtual ~KUrlNavigatorPlacesSelector(); + ~KUrlNavigatorPlacesSelector() Q_DECL_OVERRIDE; /** * Updates the selection dependent from the given URL \a url. The diff --git a/src/filewidgets/kurlnavigatortogglebutton_p.h b/src/filewidgets/kurlnavigatortogglebutton_p.h --- a/src/filewidgets/kurlnavigatortogglebutton_p.h +++ b/src/filewidgets/kurlnavigatortogglebutton_p.h @@ -38,7 +38,7 @@ public: explicit KUrlNavigatorToggleButton(QWidget *parent); - virtual ~KUrlNavigatorToggleButton(); + ~KUrlNavigatorToggleButton() Q_DECL_OVERRIDE; /** @see QWidget::sizeHint() */ QSize sizeHint() const Q_DECL_OVERRIDE; diff --git a/src/ioslaves/file/file_unix.cpp b/src/ioslaves/file/file_unix.cpp --- a/src/ioslaves/file/file_unix.cpp +++ b/src/ioslaves/file/file_unix.cpp @@ -418,13 +418,21 @@ { constexpr auto attrName = "system.ntfs_attrib_be"; const auto filenameEncoded = QFile::encodeName(filename); +#ifdef Q_OS_MACOS + auto length = getxattr(filenameEncoded.data(), attrName, nullptr, 0, 0, XATTR_NOFOLLOW); +#else auto length = getxattr(filenameEncoded.data(), attrName, nullptr, 0); +#endif if (length <= 0) { return false; } constexpr size_t xattr_size = 1024; char strAttr[xattr_size]; +#ifdef Q_OS_MACOS + length = getxattr(filenameEncoded.data(), attrName, strAttr, xattr_size, 0, XATTR_NOFOLLOW); +#else length = getxattr(filenameEncoded.data(), attrName, strAttr, xattr_size); +#endif if (length <= 0) { return false; } diff --git a/src/ioslaves/file/kauth/file.actions b/src/ioslaves/file/kauth/file.actions --- a/src/ioslaves/file/kauth/file.actions +++ b/src/ioslaves/file/kauth/file.actions @@ -2,9 +2,11 @@ Name=Execute action as root. Name[ca]=Executa l'acció com a administrador. Name[ca@valencia]=Executa l'acció com a administrador. +Name[cs]=Spustit činnost jako root... Name[de]=Aktion als „root“ ausführen. Name[en_GB]=Execute action as root. Name[es]=Ejecutar acción como administrador. +Name[eu]=Exekutatu ekintza root gisa. Name[fi]=Suorita toiminto pääkäyttäjänä. Name[fr]=Exécuter une action en tant que superutilisateur. Name[gl]=Executar a acción como root. @@ -23,9 +25,11 @@ Description=Root privileges are required to complete the action. Description[ca]=Es requereixen privilegis d'administrador per completar l'acció. Description[ca@valencia]=Es requereixen privilegis d'administrador per completar l'acció. +Description[cs]=Pro dokončení této činnosti jsou vyžadována práva uživatele root. Description[de]=Zum Abschluss der Aktion sind Rechte als Systemverwalter erforderlich. Description[en_GB]=Root privileges are required to complete the action. Description[es]=Se necesitan permisos de administrador para completar la acción. +Description[eu]=Root-en pribilegioak behar dira ekintza hau burutzeko. Description[fi]=Toiminnon suorittaminen vaatii pääkäyttäjäoikeuksia. Description[fr]=Vous devez disposer des privilèges du superutilisateur pour effectuer cette action. Description[gl]=Requírense privilexios de root para completar a acción. diff --git a/src/ioslaves/trash/kcmtrash.desktop b/src/ioslaves/trash/kcmtrash.desktop --- a/src/ioslaves/trash/kcmtrash.desktop +++ b/src/ioslaves/trash/kcmtrash.desktop @@ -77,7 +77,7 @@ Name[wa]=Batch Name[x-test]=xxTrashxx Name[zh_CN]=回收站 -Name[zh_TW]=資源回收筒 +Name[zh_TW]=垃圾桶 Comment=This service allows configuration of the trash. Comment[ar]=تتيح هذه الخدمة ضبط المهملات. Comment[ast]=Esti serviciu permite la configuración de la papelera. @@ -156,7 +156,7 @@ Comment[wa]=Ci siervice permet l' apontiaedje do batch. Comment[x-test]=xxThis service allows configuration of the trash.xx Comment[zh_CN]=此服务允许您配置回收站。 -Comment[zh_TW]=此服務允許設定資源回收筒的檢視。 +Comment[zh_TW]=此服務允許設定垃圾桶的檢視。 [Desktop Entry] Icon=user-trash @@ -247,7 +247,7 @@ Name[wa]=Batch Name[x-test]=xxTrashxx Name[zh_CN]=回收站 -Name[zh_TW]=資源回收筒 +Name[zh_TW]=垃圾桶 Comment=Configure trash settings Comment[ar]=إعدادات ضبط المهملات Comment[be@latin]=Naładź śmietnicu @@ -326,7 +326,7 @@ Comment[wa]=Apontyî les tchuzes do batch Comment[x-test]=xxConfigure trash settingsxx Comment[zh_CN]=配置回收站设置 -Comment[zh_TW]=設定資源回收筒 +Comment[zh_TW]=設定垃圾桶 X-KDE-Keywords=trash X-KDE-Keywords[ast]=pepelera X-KDE-Keywords[bg]=trash,кошче diff --git a/src/pathhelpers_p.h b/src/pathhelpers_p.h --- a/src/pathhelpers_p.h +++ b/src/pathhelpers_p.h @@ -30,7 +30,9 @@ { Q_ASSERT(!path2.startsWith(QLatin1Char('/'))); - if (!path1.endsWith(QLatin1Char('/'))) { + if (path1.isEmpty()) { + return path2; + } else if (!path1.endsWith(QLatin1Char('/'))) { return path1 + QLatin1Char('/') + path2; } else { return path1 + path2; diff --git a/src/urifilters/ikws/searchproviders/qt.desktop b/src/urifilters/ikws/searchproviders/qt.desktop --- a/src/urifilters/ikws/searchproviders/qt.desktop +++ b/src/urifilters/ikws/searchproviders/qt.desktop @@ -93,9 +93,11 @@ Query=https://doc.qt.io/qt-5/search-results.html?q=\\{@} Query[ca]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} Query[ca@valencia]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} +Query[cs]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} Query[de]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} Query[en_GB]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} Query[es]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} +Query[eu]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} Query[fi]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} Query[fr]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} Query[gl]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} @@ -105,6 +107,7 @@ Query[nn]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} Query[pl]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} Query[pt]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} +Query[ru]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} Query[sl]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} Query[sr]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} Query[sr@ijekavian]=https://doc.qt.io/qt-5/search-results.html?q=\\{@} diff --git a/src/urifilters/ikws/searchproviders/qt4.desktop b/src/urifilters/ikws/searchproviders/qt4.desktop --- a/src/urifilters/ikws/searchproviders/qt4.desktop +++ b/src/urifilters/ikws/searchproviders/qt4.desktop @@ -58,9 +58,11 @@ Query=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} Query[ca]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} Query[ca@valencia]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} +Query[cs]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} Query[de]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} Query[en_GB]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} Query[es]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} +Query[eu]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} Query[fi]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} Query[fr]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} Query[gl]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} @@ -70,6 +72,7 @@ Query[nn]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} Query[pl]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} Query[pt]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} +Query[ru]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} Query[sl]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} Query[sr]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} Query[sr@ijekavian]=https://doc.qt.io/archives/qt-4.8/search-results.html?q=\\{@} diff --git a/src/widgets/kpropertiesdialog.cpp b/src/widgets/kpropertiesdialog.cpp --- a/src/widgets/kpropertiesdialog.cpp +++ b/src/widgets/kpropertiesdialog.cpp @@ -1941,6 +1941,9 @@ #ifdef Q_OS_FREEBSD struct statfs buf; fileSystemSupportsACLs = (statfs(path.data(), &buf) == 0) && (buf.f_flags & MNT_ACLS); +#elif defined Q_OS_MACOS + fileSystemSupportsACLs = + getxattr(path.data(), "system.posix_acl_access", nullptr, 0, 0, XATTR_NOFOLLOW) >= 0 || errno == ENODATA; #else fileSystemSupportsACLs = getxattr(path.data(), "system.posix_acl_access", nullptr, 0) >= 0 || errno == ENODATA;