project(Dolphin)
# KDE Application Version, managed by release script
-set (KDE_APPLICATIONS_VERSION_MAJOR "16")
-set (KDE_APPLICATIONS_VERSION_MINOR "12")
-set (KDE_APPLICATIONS_VERSION_MICRO "1")
+set (KDE_APPLICATIONS_VERSION_MAJOR "17")
+set (KDE_APPLICATIONS_VERSION_MINOR "03")
+set (KDE_APPLICATIONS_VERSION_MICRO "70")
set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")
-set(QT_MIN_VERSION "5.4.0")
+set(QT_MIN_VERSION "5.5.0")
set(KF5_MIN_VERSION "5.21.0")
set(ECM_MIN_VERSION "1.6.0")
<listitem><para>
A file or folder can be opened by clicking it with the &LMB; (or
double-clicking, if <guilabel>Double-click to open files and folders</guilabel>
-is enabled in the <link linkend="preferences-dialog-navigation"><quote>Navigation</quote>
-section of the settings</link>).
+is enabled in the &systemsettings; in the <menuchoice><guimenu>Input Devices</guimenu>
+<guimenuitem>Mouse</guimenuitem></menuchoice> module.
</para></listitem>
<listitem><para>
<para>The option from <guilabel>Everywhere</guilabel> with activated Baloo
services searches in all indexed folders, without Baloo this option
starts the search from the user's <replaceable>Home</replaceable> folder.</para>
-
+<!--FIXME 16.12
+https://git.reviewboard.kde.org/r/123883/
+Add prototype of a "More search tools..." button
+-->
<screenshot>
<screeninfo>Search with More Options</screeninfo>
<mediaobject>
+include(ECMAddAppIcon)
configure_file(config-baloo.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-baloo.h)
set(dolphin_SRCS ${dolphin_SRCS} panels/terminal/terminalpanel.cpp)
endif()
-# TODO Does anything replace kde4_add_app_icon ?
-#kde4_add_app_icon(dolphin_SRCS "${KDE4_ICON_INSTALL_DIR}/oxygen/*/apps/system-file-manager.png")
+# Sets the icon on Windows and OSX
+file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*system-file-manager.png")
+ecm_add_app_icon(dolphin_SRCS ICONS ${ICONS_SRCS})
kf5_add_kdeinit_executable(dolphin ${dolphin_SRCS})
if (uiDelegate.askDeleteConfirmation(QList<QUrl>(), KIO::JobUiDelegate::EmptyTrash, KIO::JobUiDelegate::DefaultConfirmation)) {
KIO::Job* job = KIO::emptyTrash();
KJobWidgets::setWindow(job, m_mainWindow);
- job->ui()->setAutoErrorHandlingEnabled(true);
+ job->uiDelegate()->setAutoErrorHandlingEnabled(true);
}
}
}
DolphinDockTitleBar(QWidget* parent = 0) : QWidget(parent) {}
virtual ~DolphinDockTitleBar() {}
- virtual QSize minimumSizeHint() const
+ QSize minimumSizeHint() const Q_DECL_OVERRIDE
{
const int border = style()->pixelMetric(QStyle::PM_DockWidgetTitleBarButtonMargin);
return QSize(border, border);
}
- virtual QSize sizeHint() const
+ QSize sizeHint() const Q_DECL_OVERRIDE
{
return minimumSizeHint();
}
} else if (KProtocolManager::supportsListing(url)) {
// stat the URL to see if it is a dir or not
m_lastHandleUrlStatJob = KIO::stat(url, KIO::HideProgressInfo);
- if (m_lastHandleUrlStatJob->ui()) {
+ if (m_lastHandleUrlStatJob->uiDelegate()) {
KJobWidgets::setWindow(m_lastHandleUrlStatJob, this);
}
connect(m_lastHandleUrlStatJob, &KIO::Job::result,
}
}
- QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName();
- if (fileName.isEmpty()) {
- fileName = '/';
+ if (GeneralSettings::showFullPathInTitlebar()) {
+ const QString path = url.adjusted(QUrl::StripTrailingSlash).path();
+ caption.append(path);
+ } else {
+ QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName();
+ if (fileName.isEmpty()) {
+ fileName = '/';
+ }
+ caption.append(fileName);
}
- caption.append(fileName);
-
setWindowTitle(caption);
}
const bool splitView = GeneralSettings::splitView();
m_tabWidget->currentTabPage()->setSplitViewEnabled(splitView);
updateSplitAction();
+ setUrlAsCaption(activeViewContainer()->url());
}
emit settingsChanged();
this, &DolphinPart::slotErrorMessage);
connect(m_view, &DolphinView::directoryLoadingCompleted, this, static_cast<void(DolphinPart::*)()>(&DolphinPart::completed));
+ connect(m_view, &DolphinView::directoryLoadingCompleted, this, &DolphinPart::updatePasteAction);
connect(m_view, &DolphinView::directoryLoadingProgress, this, &DolphinPart::updateProgress);
connect(m_view, &DolphinView::errorMessage, this, &DolphinPart::slotErrorMessage);
Type=Service
Name=Dolphin View
Name[ar]=منظور دولفين
-Name[ast]=Vista de Dolphin
Name[ca]=Vista del Dolphin
Name[ca@valencia]=Vista del Dolphin
Name[cs]=Pohled Dolphin
[Desktop Action compact]
Name=Compact
Name[ar]=متراصّ
-Name[ast]=Compautu
Name[ca]=Compacta
Name[ca@valencia]=Compacta
Name[cs]=Kompaktní
DolphinTabWidget::DolphinTabWidget(QWidget* parent) :
QTabWidget(parent),
- m_placesSelectorVisible(true)
+ m_placesSelectorVisible(true),
+ m_previousTab(-1)
{
connect(this, &DolphinTabWidget::tabCloseRequested,
this, static_cast<void (DolphinTabWidget::*)(int)>(&DolphinTabWidget::closeTab));
void DolphinTabWidget::currentTabChanged(int index)
{
DolphinViewContainer* viewContainer = tabPageAt(index)->activeViewContainer();
+ viewContainer->setActive(true);
emit activeViewChanged(viewContainer);
emit currentUrlChanged(viewContainer->url());
viewContainer->view()->setFocus();
+
+ if (tabPageAt(m_previousTab)) {
+ tabPageAt(m_previousTab)->activeViewContainer()->setActive(false);
+ }
+ m_previousTab = index;
}
void DolphinTabWidget::tabInserted(int index)
private:
/** Caches the (negated) places panel visibility */
bool m_placesSelectorVisible;
+
+ int m_previousTab;
};
#endif
if (text.isEmpty()) {
text = url().host();
}
+ if (text.isEmpty()) {
+ text = url().scheme();
+ }
}
return text;
const KIO::filesize_t size = roleValue.value<KIO::filesize_t>();
text = KFormat().formatByteSize(size);
}
- } else if (role == "date") {
+ } else if (role == "modificationtime" || role == "accesstime") {
const QDateTime dateTime = roleValue.toDateTime();
text = QLocale().toString(dateTime, QLocale::ShortFormat);
} else {
connect(m_dirLister, static_cast<void(KFileItemModelDirLister::*)()>(&KFileItemModelDirLister::clear), this, &KFileItemModel::slotClear);
connect(m_dirLister, &KFileItemModelDirLister::infoMessage, this, &KFileItemModel::infoMessage);
connect(m_dirLister, &KFileItemModelDirLister::errorMessage, this, &KFileItemModel::errorMessage);
+ connect(m_dirLister, &KFileItemModelDirLister::percent, this, &KFileItemModel::directoryLoadingProgress);
connect(m_dirLister, static_cast<void(KFileItemModelDirLister::*)(const QUrl&, const QUrl&)>(&KFileItemModelDirLister::redirection), this, &KFileItemModel::directoryRedirection);
connect(m_dirLister, &KFileItemModelDirLister::urlIsFileError, this, &KFileItemModel::urlIsFileError);
switch (typeForRole(sortRole())) {
case NameRole: m_groups = nameRoleGroups(); break;
case SizeRole: m_groups = sizeRoleGroups(); break;
- case DateRole: m_groups = dateRoleGroups(); break;
+ case ModificationTimeRole: m_groups = timeRoleGroups(KFileItem::ModificationTime); break;
+ case AccessTimeRole: m_groups = timeRoleGroups(KFileItem::AccessTime); break;
case PermissionsRole: m_groups = permissionRoleGroups(); break;
case RatingRole: m_groups = ratingRoleGroups(); break;
default: m_groups = genericStringRoleGroups(sortRole()); break;
foreach (const QUrl& url, indexesForUrl.uniqueKeys()) {
if (indexesForUrl.count(url) > 1) {
qCWarning(DolphinDebug) << "Multiple items found with the URL" << url;
- foreach (int index, indexesForUrl.values(url)) {
- const ItemData* data = m_itemData.at(index);
- qCWarning(DolphinDebug) << "index" << index << ":" << data->item;
+
+ auto it = indexesForUrl.find(url);
+ while (it != indexesForUrl.end() && it.key() == url) {
+ const ItemData* data = m_itemData.at(it.value());
+ qCWarning(DolphinDebug) << "index" << it.value() << ":" << data->item;
if (data->parent) {
qCWarning(DolphinDebug) << "parent" << data->parent->item;
}
+ ++it;
}
}
}
QSet<QUrl> KFileItemModel::expandedDirectories() const
{
- return m_expandedDirs.values().toSet();
+ QSet<QUrl> result;
+ const auto dirs = m_expandedDirs;
+ for (const auto &dir : dirs) {
+ result.insert(dir);
+ }
+ return result;
}
void KFileItemModel::restoreExpandedDirectories(const QSet<QUrl> &urls)
data.insert(sharedValue("size"), item.size());
}
- if (m_requestRole[DateRole]) {
+ if (m_requestRole[ModificationTimeRole]) {
// Don't use KFileItem::timeString() as this is too expensive when
// having several thousands of items. Instead the formatting of the
// date-time will be done on-demand by the view when the date will be shown.
const QDateTime dateTime = item.time(KFileItem::ModificationTime);
- data.insert(sharedValue("date"), dateTime);
+ data.insert(sharedValue("modificationtime"), dateTime);
+ }
+
+ if (m_requestRole[AccessTimeRole]) {
+ // Don't use KFileItem::timeString() as this is too expensive when
+ // having several thousands of items. Instead the formatting of the
+ // date-time will be done on-demand by the view when the date will be shown.
+ const QDateTime dateTime = item.time(KFileItem::AccessTime);
+ data.insert(sharedValue("accesstime"), dateTime);
}
if (m_requestRole[PermissionsRole]) {
break;
}
- case DateRole: {
+ case ModificationTimeRole: {
const QDateTime dateTimeA = itemA.time(KFileItem::ModificationTime);
const QDateTime dateTimeB = itemB.time(KFileItem::ModificationTime);
if (dateTimeA < dateTimeB) {
return groups;
}
-QList<QPair<int, QVariant> > KFileItemModel::dateRoleGroups() const
+QList<QPair<int, QVariant> > KFileItemModel::timeRoleGroups(KFileItem::FileTimes which) const
{
Q_ASSERT(!m_itemData.isEmpty());
const QDate currentDate = QDate::currentDate();
- QDate previousModifiedDate;
+ QDate previousFileDate;
QString groupValue;
for (int i = 0; i <= maxIndex; ++i) {
if (isChildItem(i)) {
continue;
}
- const QDateTime modifiedTime = m_itemData.at(i)->item.time(KFileItem::ModificationTime);
- const QDate modifiedDate = modifiedTime.date();
- if (modifiedDate == previousModifiedDate) {
+ const QDateTime fileTime = m_itemData.at(i)->item.time(which);
+ const QDate fileDate = fileTime.date();
+ if (fileDate == previousFileDate) {
// The current item is in the same group as the previous item
continue;
}
- previousModifiedDate = modifiedDate;
+ previousFileDate = fileDate;
- const int daysDistance = modifiedDate.daysTo(currentDate);
+ const int daysDistance = fileDate.daysTo(currentDate);
QString newGroupValue;
- if (currentDate.year() == modifiedDate.year() &&
- currentDate.month() == modifiedDate.month()) {
+ if (currentDate.year() == fileDate.year() &&
+ currentDate.month() == fileDate.month()) {
switch (daysDistance / 7) {
case 0:
case 0: newGroupValue = i18nc("@title:group Date", "Today"); break;
case 1: newGroupValue = i18nc("@title:group Date", "Yesterday"); break;
default:
- newGroupValue = modifiedTime.toString(
+ newGroupValue = fileTime.toString(
i18nc("@title:group Date: The week day name: dddd", "dddd"));
newGroupValue = i18nc("Can be used to script translation of \"dddd\""
"with context @title:group Date", "%1", newGroupValue);
}
} else {
const QDate lastMonthDate = currentDate.addMonths(-1);
- if (lastMonthDate.year() == modifiedDate.year() &&
- lastMonthDate.month() == modifiedDate.month()) {
+ if (lastMonthDate.year() == fileDate.year() &&
+ lastMonthDate.month() == fileDate.month()) {
if (daysDistance == 1) {
- newGroupValue = modifiedTime.toString(i18nc("@title:group Date: "
+ newGroupValue = fileTime.toString(i18nc("@title:group Date: "
"MMMM is full month name in current locale, and yyyy is "
"full year number", "'Yesterday' (MMMM, yyyy)"));
newGroupValue = i18nc("Can be used to script translation of "
"\"'Yesterday' (MMMM, yyyy)\" with context @title:group Date",
"%1", newGroupValue);
} else if (daysDistance <= 7) {
- newGroupValue = modifiedTime.toString(i18nc("@title:group Date: "
+ newGroupValue = fileTime.toString(i18nc("@title:group Date: "
"The week day name: dddd, MMMM is full month name "
"in current locale, and yyyy is full year number",
"dddd (MMMM, yyyy)"));
"\"dddd (MMMM, yyyy)\" with context @title:group Date",
"%1", newGroupValue);
} else if (daysDistance <= 7 * 2) {
- newGroupValue = modifiedTime.toString(i18nc("@title:group Date: "
+ newGroupValue = fileTime.toString(i18nc("@title:group Date: "
"MMMM is full month name in current locale, and yyyy is "
"full year number", "'One Week Ago' (MMMM, yyyy)"));
newGroupValue = i18nc("Can be used to script translation of "
"\"'One Week Ago' (MMMM, yyyy)\" with context @title:group Date",
"%1", newGroupValue);
} else if (daysDistance <= 7 * 3) {
- newGroupValue = modifiedTime.toString(i18nc("@title:group Date: "
+ newGroupValue = fileTime.toString(i18nc("@title:group Date: "
"MMMM is full month name in current locale, and yyyy is "
"full year number", "'Two Weeks Ago' (MMMM, yyyy)"));
newGroupValue = i18nc("Can be used to script translation of "
"\"'Two Weeks Ago' (MMMM, yyyy)\" with context @title:group Date",
"%1", newGroupValue);
} else if (daysDistance <= 7 * 4) {
- newGroupValue = modifiedTime.toString(i18nc("@title:group Date: "
+ newGroupValue = fileTime.toString(i18nc("@title:group Date: "
"MMMM is full month name in current locale, and yyyy is "
"full year number", "'Three Weeks Ago' (MMMM, yyyy)"));
newGroupValue = i18nc("Can be used to script translation of "
"\"'Three Weeks Ago' (MMMM, yyyy)\" with context @title:group Date",
"%1", newGroupValue);
} else {
- newGroupValue = modifiedTime.toString(i18nc("@title:group Date: "
+ newGroupValue = fileTime.toString(i18nc("@title:group Date: "
"MMMM is full month name in current locale, and yyyy is "
"full year number", "'Earlier on' MMMM, yyyy"));
newGroupValue = i18nc("Can be used to script translation of "
"%1", newGroupValue);
}
} else {
- newGroupValue = modifiedTime.toString(i18nc("@title:group "
+ newGroupValue = fileTime.toString(i18nc("@title:group "
"The month and year: MMMM is full month name in current locale, "
"and yyyy is full year number", "MMMM, yyyy"));
newGroupValue = i18nc("Can be used to script translation of "
{ 0, NoRole, 0, 0, 0, 0, false, false },
{ "text", NameRole, I18N_NOOP2_NOSTRIP("@label", "Name"), 0, 0, false, false },
{ "size", SizeRole, I18N_NOOP2_NOSTRIP("@label", "Size"), 0, 0, false, false },
- { "date", DateRole, I18N_NOOP2_NOSTRIP("@label", "Date"), 0, 0, false, false },
+ { "modificationtime", ModificationTimeRole, I18N_NOOP2_NOSTRIP("@label", "Modified"), 0, 0, false, false },
+ { "accesstime", AccessTimeRole, I18N_NOOP2_NOSTRIP("@label", "Accessed"), 0, 0, false, false },
{ "type", TypeRole, I18N_NOOP2_NOSTRIP("@label", "Type"), 0, 0, false, false },
{ "rating", RatingRole, I18N_NOOP2_NOSTRIP("@label", "Rating"), 0, 0, true, false },
{ "tags", TagsRole, I18N_NOOP2_NOSTRIP("@label", "Tags"), 0, 0, true, false },
{ "comment", CommentRole, I18N_NOOP2_NOSTRIP("@label", "Comment"), 0, 0, true, false },
+ { "title", TitleRole, I18N_NOOP2_NOSTRIP("@label", "Title"), I18N_NOOP2_NOSTRIP("@label", "Document"), true, true },
{ "wordCount", WordCountRole, I18N_NOOP2_NOSTRIP("@label", "Word Count"), I18N_NOOP2_NOSTRIP("@label", "Document"), true, true },
{ "lineCount", LineCountRole, I18N_NOOP2_NOSTRIP("@label", "Line Count"), I18N_NOOP2_NOSTRIP("@label", "Document"), true, true },
{ "imageSize", ImageSizeRole, I18N_NOOP2_NOSTRIP("@label", "Image Size"), I18N_NOOP2_NOSTRIP("@label", "Image"), true, true },
private:
enum RoleType {
// User visible roles:
- NoRole, NameRole, SizeRole, DateRole, PermissionsRole, OwnerRole,
+ NoRole, NameRole, SizeRole, ModificationTimeRole, AccessTimeRole, PermissionsRole, OwnerRole,
GroupRole, TypeRole, DestinationRole, PathRole,
// User visible roles available with Baloo:
CommentRole, TagsRole, RatingRole, ImageSizeRole, OrientationRole,
- WordCountRole, LineCountRole, ArtistRole, AlbumRole, DurationRole, TrackRole,
+ WordCountRole, TitleRole, LineCountRole, ArtistRole, AlbumRole, DurationRole, TrackRole,
OriginUrlRole,
// Non-visible roles:
IsDirRole, IsLinkRole, IsExpandedRole, IsExpandableRole, ExpandedParentsCountRole,
QList<QPair<int, QVariant> > nameRoleGroups() const;
QList<QPair<int, QVariant> > sizeRoleGroups() const;
- QList<QPair<int, QVariant> > dateRoleGroups() const;
+ QList<QPair<int, QVariant> > timeRoleGroups(KFileItem::FileTimes which) const;
QList<QPair<int, QVariant> > permissionRoleGroups() const;
QList<QPair<int, QVariant> > ratingRoleGroups() const;
QList<QPair<int, QVariant> > genericStringRoleGroups(const QByteArray& typeForRole) const;
KIO::PreviewJob* job = new KIO::PreviewJob(itemSubSet, cacheSize, &m_enabledPlugins);
job->setIgnoreMaximumSize(itemSubSet.first().isLocalFile());
- if (job->ui()) {
+ if (job->uiDelegate()) {
KJobWidgets::setWindow(job, qApp->activeWindow());
}
public:
KItemListContainerViewport(QGraphicsScene* scene, QWidget* parent);
protected:
- virtual void wheelEvent(QWheelEvent* event);
+ void wheelEvent(QWheelEvent* event) Q_DECL_OVERRIDE;
};
KItemListContainerViewport::KItemListContainerViewport(QGraphicsScene* scene, QWidget* parent) :
class DOLPHIN_EXPORT KItemListController : public QObject
{
Q_OBJECT
- Q_ENUMS(SelectionBehavior)
Q_PROPERTY(KItemModelBase* model READ model WRITE setModel)
Q_PROPERTY(KItemListView *view READ view WRITE setView)
Q_PROPERTY(SelectionBehavior selectionBehavior READ selectionBehavior WRITE setSelectionBehavior)
SingleSelection,
MultiSelection
};
+ Q_ENUM(SelectionBehavior)
enum AutoActivationBehavior {
ActivationAndExpansion,
void KItemListWidget::setColumnWidth(const QByteArray& role, qreal width)
{
- if (m_columnWidths.value(role) != width) {
- const qreal previousWidth = width;
+ const qreal previousWidth = m_columnWidths.value(role);
+ if (previousWidth != width) {
m_columnWidths.insert(role, width);
columnWidthChanged(role, width, previousWidth);
update();
{ "rating", "rating" },
{ "tag", "tags" },
{ "comment", "comment" },
+ { "title", "title" },
{ "wordCount", "wordCount" },
{ "lineCount", "lineCount" },
{ "width", "imageSize" },
void urlIsFileError(const QUrl& url);
protected:
- virtual void handleError(KIO::Job* job);
+ void handleError(KIO::Job* job) Q_DECL_OVERRIDE;
};
#endif
qreal minimumColumnWidth() const;
- virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
+ void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0) Q_DECL_OVERRIDE;
signals:
/**
void sortRoleChanged(const QByteArray& current, const QByteArray& previous);
protected:
- virtual void mousePressEvent(QGraphicsSceneMouseEvent* event);
- virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
- virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
- virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event);
- virtual void hoverEnterEvent(QGraphicsSceneHoverEvent* event);
- virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent* event);
- virtual void hoverMoveEvent(QGraphicsSceneHoverEvent* event);
+ void mousePressEvent(QGraphicsSceneMouseEvent* event) Q_DECL_OVERRIDE;
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) Q_DECL_OVERRIDE;
+ void mouseMoveEvent(QGraphicsSceneMouseEvent* event) Q_DECL_OVERRIDE;
+ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) Q_DECL_OVERRIDE;
+ void hoverEnterEvent(QGraphicsSceneHoverEvent* event) Q_DECL_OVERRIDE;
+ void hoverLeaveEvent(QGraphicsSceneHoverEvent* event) Q_DECL_OVERRIDE;
+ void hoverMoveEvent(QGraphicsSceneHoverEvent* event) Q_DECL_OVERRIDE;
private slots:
void slotSortRoleChanged(const QByteArray& current, const QByteArray& previous);
void setRole(const QByteArray& role);
QByteArray role() const;
- virtual bool eventFilter(QObject* watched, QEvent* event);
+ bool eventFilter(QObject* watched, QEvent* event) Q_DECL_OVERRIDE;
signals:
void roleEditingFinished(const QByteArray& role, const QVariant& value);
void roleEditingCanceled(const QByteArray& role, const QVariant& value);
protected:
- virtual bool event(QEvent* event);
- virtual void keyPressEvent(QKeyEvent* event);
+ bool event(QEvent* event) Q_DECL_OVERRIDE;
+ void keyPressEvent(QKeyEvent* event) Q_DECL_OVERRIDE;
private slots:
/**
void setHovered(bool hovered);
- virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
+ void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0) Q_DECL_OVERRIDE;
protected:
- virtual void resizeEvent(QGraphicsSceneResizeEvent* event);
+ void resizeEvent(QGraphicsSceneResizeEvent* event) Q_DECL_OVERRIDE;
private:
void updatePixmap();
void handleWheelEvent(QWheelEvent* event);
protected:
- virtual bool eventFilter(QObject* obj, QEvent* event);
+ bool eventFilter(QObject* obj, QEvent* event) Q_DECL_OVERRIDE;
private slots:
void slotAnimationStateChanged(QAbstractAnimation::State newState,
{
QApplication app(argc, argv);
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
- app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager")));
+ app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon()));
KCrash::initialize();
<description>
<p>Dolphin is a lightweight file manager. It has been designed with ease of use and simplicity in mind, while still allowing flexibility and customisation. This means that you can do your file management exactly the way you want to do it.</p>
<p xml:lang="ar">دولفين هو مدير ملفات خفيف. صُمِّم دولفين مع أخذ سهولة الاستخدام والبساطة بعين الاعتبار، مع السماح بالمرونة والتخصيص. يعني هذا أنه يمكنك إدارة ملفاتك كما تريد تمامًا.</p>
- <p xml:lang="ast">Dolphin ye un xestor de ficheros llixeru. Diseñóse cola facilidá d'usu y cenciellez na miente entrín entá permite la flexibilidá y personalización. Esto quier dicir que pues facer la to xestión de ficheros exautamente como tu quies facela.</p>
+ <p xml:lang="ast">Dolphin ye un xestor de ficheros llixeru. Diseñóse cola facilidá y cenciellez d'usu en mente, el mesmu tiempu qu'entá permite la flixibilidá y personalización. Quier dicir que pues facer la to xestión de ficheros exautamente como quieras facelo.</p>
<p xml:lang="bs">Dolphinje lagan file manager. On je bio dizajniran sa lakoćom korišćenja i jednostavnosti u vidu, još omogućavajući fleksibilnost i prilagođavanje. To znači da možete da radite svoje upravljanje datotekama onako kako želite da to uradi.</p>
<p xml:lang="ca">El Dolphin és un gestor de fitxers lleuger. S'ha dissenyat pensant a facilitar el seu ús i que sigui simple, permetent la flexibilitat i la personalització. Això vol dir que podeu fer la gestió dels vostres fitxers de la manera exacta com ho vulgueu fer.</p>
<p xml:lang="ca-valencia">El Dolphin és un gestor de fitxers lleuger. S'ha dissenyat pensant a facilitar el seu ús i que siga simple, permetent la flexibilitat i la personalització. Això vol dir que podeu fer la gestió dels vostres fitxers de la manera exacta com ho vulgueu fer.</p>
<p xml:lang="zh-TW">Dolphin 是一套輕量級的檔案管理員。它設計的理念是易用與簡單,但仍然保持足夠的彈性。這表示您可以用您想要使用的方式來管理您的檔案。</p>
<p>Features:</p>
<p xml:lang="ar">المزايا:</p>
- <p xml:lang="ast">Carauterístiques</p>
+ <p xml:lang="ast">Carauterístiques:</p>
<p xml:lang="bs">Svojstva:</p>
<p xml:lang="ca">Característiques:</p>
<p xml:lang="ca-valencia">Característiques:</p>
<p xml:lang="zh-TW">功能:</p>
<ul>
<li>Navigation (or breadcrumb) bar for URLs, allowing you to quickly navigate through the hierarchy of files and folders.</li>
- <li xml:lang="ast">Barra de navegación </li>
<li xml:lang="bs">Navigacijska (ili mrvična) traka za URL, dopušta vam da se brzo krećete kroz hijerarhiju datoteka i direktorija.</li>
<li xml:lang="ca">Barra de navegació (o fil d'Ariadna) pels URL, permetent una navegació ràpida per la jerarquia dels fitxers i carpetes.</li>
<li xml:lang="ca-valencia">Barra de navegació (o fil d'Ariadna) pels URL, permetent una navegació ràpida per la jerarquia dels fitxers i carpetes.</li>
<li xml:lang="zh-TW">網址導覽列讓您可以快速瀏覽檔案與資料夾。</li>
<li>Supports several different kinds of view styles and properties and allows you to configure the view exactly how you want it.</li>
<li xml:lang="ar">يدعم العديد من الأنواع المختلفة من الخصائص وأنماط العرض ويسمح لك بضبط العرض كما تريد تمامًا.</li>
- <li xml:lang="ast">Sofitalla delles tribes de vista y propiedaes diferentes y permítete configurar la vista exautamente como tu quies.</li>
<li xml:lang="bs">Dopušta vište vrsta stilova pogleda i svojstava i dopšta vam da konfigurišete pogled baš kako želite.</li>
<li xml:lang="ca">Accepta diferents classes diverses d'estils de visualització i propietats i us permet configurar la visualització exactament com la vulgueu.</li>
<li xml:lang="ca-valencia">Accepta diferents classes diverses d'estils de visualització i propietats i vos permet configurar la visualització exactament com la vulgueu.</li>
<li xml:lang="zh-TW">網址導覽列讓您可以快速瀏覽檔案與資料夾。</li>
<li>Split view, allowing you to easily copy or move files between locations.</li>
<li xml:lang="ar">العرض المقسوم، يسمح لك بنسخ ونقل الملفات بين مكانين بسهولة.</li>
- <li xml:lang="ast">Vista dixebrada, permítete copiar y mover ficheros d'un mou cenciellu ente allugamientos.</li>
<li xml:lang="bs">Razdvaja pogled, dopuštajući lako kopiranje ili pomijeranje datoteka između lokacija</li>
<li xml:lang="ca">Divisió de visualització, permetent copiar o moure fitxers fàcilment entre les ubicacions.</li>
<li xml:lang="ca-valencia">Divisió de visualització, permetent copiar o moure fitxers fàcilment entre les ubicacions.</li>
<li xml:lang="zh-TW">支援數個檢視模式,您也可以調整檢視模式的屬性。</li>
<li>Additional information and shortcuts are available as dock-able panels, allowing you to move them around freely and display exactly what you want.</li>
<li xml:lang="ar">تتوفر معلومات واختصارات إضافية كلوحات قابلة للرصف، مما يسمح لك بنقلها بحريّة وعرضها بالضبط كما تريد.</li>
- <li xml:lang="ast">Tán disponibles atayos ya información adicional como paneles anclables, permitiéndote movelos pehí d'un mou llibre y amosar exautamente lo tu quies.</li>
<li xml:lang="bs">Dodatne informacije i kratice su dostupne kao usidreni paneli, dopuštajući vam da se krećete slobodno i prikažete šta želite.</li>
<li xml:lang="ca">Hi ha informació addicional i dreceres disponibles com a plafons que es poden acoblar, permetent moure'ls lliurement i mostrar exactament el què vulgueu.</li>
<li xml:lang="ca-valencia">Hi ha informació addicional i dreceres disponibles com a plafons que es poden acoblar, permetent moure'ls lliurement i mostrar exactament el què vulgueu.</li>
<li xml:lang="zh-TW">分割檢視讓您可以輕鬆複製或移動檔案。</li>
<li>Multiple tab support</li>
<li xml:lang="ar">دعم تعدّد الألسنة</li>
- <li xml:lang="ast">Sofitu de múltiples llingüetes</li>
<li xml:lang="bs">Podrška za više kartica</li>
<li xml:lang="ca">Admet pestanyes múltiples</li>
<li xml:lang="ca-valencia">Admet pestanyes múltiples</li>
<li xml:lang="zh-TW">額外資訊與嵌入式面板捷徑讓您可以輕易顯示您常用的項目。</li>
<li>Informational dialogues are displayed in an unobtrusive way.</li>
<li xml:lang="ar">حواريات المعلومات تُعرَض بطريقة غير مُزعجة.</li>
- <li xml:lang="ast">Los diálogos d'información amuésense d'un mou discretu.</li>
<li xml:lang="bs">Informativni dijalozi su prikazani na nenametljiv način.</li>
<li xml:lang="ca">Els diàlegs informatius es mostren d'una manera no molesta.</li>
<li xml:lang="ca-valencia">Els diàlegs informatius es mostren d'una manera no molesta.</li>
<li xml:lang="zh-TW">支援多分頁</li>
<li>Undo/redo support</li>
<li xml:lang="ar">دعم التراجع والإعادة</li>
- <li xml:lang="ast">Sofitu de desfechura/refechura</li>
<li xml:lang="bs">Podrška za poništavanje/ponavljanje akcija</li>
<li xml:lang="ca">Admet desfer/refer</li>
<li xml:lang="ca-valencia">Admet desfer/refer</li>
<li xml:lang="zh-TW">以不唐突的方式顯示資訊對話框。</li>
<li>Transparent network access through the KIO system.</li>
<li xml:lang="ar">اتصال شبكيّ مباشر باستخدام نظام KIO.</li>
- <li xml:lang="ast">Accesu tresparente a la rede pente'l sistema KIO.</li>
<li xml:lang="bs">Transparentni mrežni pristup kroz KIO sistem.</li>
<li xml:lang="ca">Accés transparent a la xarxa a través del sistema KIO.</li>
<li xml:lang="ca-valencia">Accés transparent a la xarxa a través del sistema KIO.</li>
KIO::Job* job = KIO::moveAs(oldUrl, newUrl);
KJobWidgets::setWindow(job, this);
KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job);
- job->ui()->setAutoErrorHandlingEnabled(true);
+ job->uiDelegate()->setAutoErrorHandlingEnabled(true);
}
}
}
KIO::Job* job = KIO::trash(list);
KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, list, QUrl(QStringLiteral("trash:/")), job);
KJobWidgets::setWindow(job, m_parent);
- job->ui()->setAutoErrorHandlingEnabled(true);
+ job->uiDelegate()->setAutoErrorHandlingEnabled(true);
}
}
if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Delete, KIO::JobUiDelegate::DefaultConfirmation)) {
KIO::Job* job = KIO::del(list);
KJobWidgets::setWindow(job, m_parent);
- job->ui()->setAutoErrorHandlingEnabled(true);
+ job->uiDelegate()->setAutoErrorHandlingEnabled(true);
}
}
// No item is hovered and no selection has been done: provide
// an item for the currently shown directory.
m_folderStatJob = KIO::stat(url(), KIO::HideProgressInfo);
- if (m_folderStatJob->ui()) {
+ if (m_folderStatJob->uiDelegate()) {
KJobWidgets::setWindow(m_folderStatJob, this);
}
connect(m_folderStatJob, &KIO::Job::result,
m_previewJob = new KIO::PreviewJob(KFileItemList() << item, QSize(m_preview->width(), m_preview->height()));
m_previewJob->setScaleType(KIO::PreviewJob::Unscaled);
m_previewJob->setIgnoreMaximumSize(item.isLocalFile());
- if (m_previewJob->ui()) {
+ if (m_previewJob->uiDelegate()) {
KJobWidgets::setWindow(m_previewJob, this);
}
updateGeometry();
}
- virtual QSize sizeHint() const
+ QSize sizeHint() const Q_DECL_OVERRIDE
{
return m_sizeHint.isValid() ? m_sizeHint : Phonon::VideoWidget::sizeHint();
}
props.setVisibleRoles({"text"});
} else if (data.url.scheme() == QLatin1String("timeline")) {
props.setViewMode(DolphinView::DetailsView);
- props.setVisibleRoles({"text", "date"});
+ props.setVisibleRoles({"text", "modificationtime"});
}
}
}
sendCdToTerminal(url.toLocalFile());
} else {
m_mostLocalUrlJob = KIO::mostLocalUrl(url, KIO::HideProgressInfo);
- if (m_mostLocalUrlJob->ui()) {
+ if (m_mostLocalUrlJob->uiDelegate()) {
KJobWidgets::setWindow(m_mostLocalUrlJob, this);
}
connect(m_mostLocalUrlJob, &KIO::StatJob::result, this, &TerminalPanel::slotMostLocalUrlResult);
#include <QLineEdit>
#include <KLocalizedString>
#include <KSeparator>
+#include <KNS3/KMoreToolsMenuFactory>
#include <QButtonGroup>
#include <QDir>
searchLocationGroup->addButton(m_fromHereButton);
searchLocationGroup->addButton(m_everywhereButton);
+ auto moreSearchToolsButton = new QToolButton(this);
+ moreSearchToolsButton->setAutoRaise(true);
+ moreSearchToolsButton->setPopupMode(QToolButton::InstantPopup);
+ moreSearchToolsButton->setIcon(QIcon::fromTheme("arrow-down-double"));
+ moreSearchToolsButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
+ moreSearchToolsButton->setText(i18n("More Search Tools"));
+ moreSearchToolsButton->setMenu(new QMenu(this));
+ connect(moreSearchToolsButton->menu(), &QMenu::aboutToShow, moreSearchToolsButton->menu(), [this, moreSearchToolsButton]()
+ {
+ m_menuFactory.reset(new KMoreToolsMenuFactory("dolphin/search-tools"));
+ moreSearchToolsButton->menu()->clear();
+ m_menuFactory->fillMenuFromGroupingNames(moreSearchToolsButton->menu(), { "files-find" }, this->m_searchPath);
+ } );
+
// Create "Facets" widgets
m_facetsToggleButton = new QToolButton(this);
m_facetsToggleButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
optionsLayout->addWidget(m_separator);
optionsLayout->addWidget(m_fromHereButton);
optionsLayout->addWidget(m_everywhereButton);
- optionsLayout->addStretch(1);
+ optionsLayout->addWidget(new KSeparator(Qt::Vertical, this));
optionsLayout->addWidget(m_facetsToggleButton);
+ optionsLayout->addWidget(moreSearchToolsButton);
+ optionsLayout->addStretch(1);
// Put the options into a QScrollArea. This prevents increasing the view width
// in case that not enough width for the options is available.
class QScrollArea;
class QLabel;
class QVBoxLayout;
+class KMoreToolsMenuFactory;
/**
* @brief Input box for searching files with or without Baloo.
DolphinFacetsWidget* m_facetsWidget;
QUrl m_searchPath;
+ QScopedPointer<KMoreToolsMenuFactory> m_menuFactory;
QTimer* m_startSearchTimer;
};
<label>Should the full path be shown inside the location bar</label>
<default>false</default>
</entry>
+ <entry name="ShowFullPathInTitlebar" type="Bool">
+ <label>Should the full path be shown in the title bar</label>
+ <default>false</default>
+ </entry>
<entry name="Version" type="Int">
<label>Internal version of Dolphin, containing 3 digits for major, minor, bugfix</label>
<default>0</default>
Name=Dolphin General
Name[ar]=دولفين العامّ
-Name[ast]=Xeneral de Dolphin
Name[ca]=General del Dolphin
Name[ca@valencia]=General del Dolphin
Name[cs]=Obecný Dolphin
Name[zh_TW]=Dolphin 一般
Comment=This service allows configuration of general Dolphin settings.
Comment[ar]=تسمح هذه الخدمة بضبط إعدادات دولفين العامّة.
-Comment[ast]=Esti serviciu permite la configuración de los axustes xenerales de Dolphin.
Comment[ca]=Aquest servei permet la configuració de l'arranjament general del Dolphin.
Comment[ca@valencia]=Este servei permet la configuració de l'arranjament general del Dolphin.
Comment[cs]=Tato služba umožňuje obecné nastavení Dolphinu.
Name[zh_TW]=一般
Comment=Configure general file manager settings
Comment[ar]=اضبط إعدادات مدير الملفّات العامّة
-Comment[ast]=Configura los axustes xenerales del xestor de ficheros
Comment[ca]=Configura les opcions generals del gestor de fitxers
Comment[ca@valencia]=Configura les opcions generals del gestor de fitxers
Comment[cs]=Obecné nastavení správce souborů
Name=Dolphin Navigation
Name[ar]=التّنقّل في دولفين
-Name[ast]=Navegación de Dolphin
Name[ca]=Navegació del Dolphin
Name[ca@valencia]=Navegació del Dolphin
Name[cs]=Navigace Dolphinu
Name[zh_TW]=Dolphin 導覽
Comment=This service allows configuration of the Dolphin navigation.
Comment[ar]=تسمح هذه الخدمة بضبط التّنقّل في دولفين.
-Comment[ast]=Esti serviciu permite la configuración de la navegación de Dolphin.
Comment[ca]=Aquest servei permet la configuració de la navegació del Dolphin.
Comment[ca@valencia]=Este servei permet la configuració de la navegació del Dolphin.
Comment[cs]=Tato služba umožňuje nastavení navigace v Dolphinu.
Name[zh_TW]=導覽
Comment=Configure file manager navigation
Comment[ar]=اضبط التّنقّل في مدير الملفّات
-Comment[ast]=Configura la navegación del xestor de ficheros
Comment[ca]=Configura la navegació del gestor de fitxers
Comment[ca@valencia]=Configura la navegació del gestor de fitxers
Comment[cs]=Nastavení navigace správce souborů
Name[zh_TW]=服務
Comment=Configure file manager services
Comment[ar]=اضبط خدمات مدير الملفّات
-Comment[ast]=Configura los servicios del xestor de ficheros
Comment[ca]=Configura els serveis del gestor de fitxers
Comment[ca@valencia]=Configura els serveis del gestor de fitxers
Comment[cs]=Nastavení služeb správce souborů
Name=Dolphin View Modes
Name[ar]=أوضاع المنظور في دولفين
-Name[ast]=Moos de vista de Dolphin
Name[ca]=Modes de vista del Dolphin
Name[ca@valencia]=Modes de vista del Dolphin
Name[cs]=Režimy pohledů Dolphinu
Name[zh_TW]=設定檔案管理員服務
Comment=This service allows configuration of the Dolphin view modes.
Comment[ar]=تسمح هذه الخدمة بضبط أوضاع المنظور في دولفين.
-Comment[ast]=Esti serviciu permite la configuración de los moos de vista de Dolphin.
Comment[ca]=Aquest servei permet la configuració dels modes de vista del Dolphin.
Comment[ca@valencia]=Este servei permet la configuració dels modes de vista del Dolphin.
Comment[cs]=Tato služba umožňuje nastavení režimů pohledu Dolphinu.
X-DocPath=dolphin/index.html#preferences-dialog-viewmodes
Name=View Modes
Name[ar]=أوضاع المنظور
-Name[ast]=Moos de vista
Name[ca]=Modes de vista
Name[ca@valencia]=Modes de vista
Name[cs]=Režimy pohledu
Name[zh_TW]=檢視模式
Comment=Configure file manager view modes
Comment[ar]=اضبط أوضاع المنظور في مدير الملفّات
-Comment[ast]=Configura los moos de vista del xestor de ficheros
Comment[ca]=Configura els modes de vista del gestor de fitxers
Comment[ca@valencia]=Configura els modes de vista del gestor de fitxers
Comment[cs]=Nastavení režimů pohledu správce souborů
m_splitView(0),
m_editableUrl(0),
m_showFullPath(0),
- m_filterBar(0)
+ m_filterBar(0),
+ m_showFullPathInTitlebar(0)
{
QVBoxLayout* topLayout = new QVBoxLayout(this);
QWidget* vBox = new QWidget(this);
vBoxLayout->addWidget(m_showFullPath);
m_filterBar = new QCheckBox(i18nc("@option:check Startup Settings", "Show filter bar"), vBox);
vBoxLayout->addWidget(m_filterBar);
+ m_showFullPathInTitlebar = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path in title bar"), vBox);
+ vBoxLayout->addWidget(m_showFullPathInTitlebar);
// Add a dummy widget with no restriction regarding
// a vertical resizing. This assures that the dialog layout
connect(m_editableUrl, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
connect(m_showFullPath, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
connect(m_filterBar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
+ connect(m_showFullPathInTitlebar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
}
StartupSettingsPage::~StartupSettingsPage()
settings->setEditableUrl(m_editableUrl->isChecked());
settings->setShowFullPath(m_showFullPath->isChecked());
settings->setFilterBar(m_filterBar->isChecked());
+ settings->setShowFullPathInTitlebar(m_showFullPathInTitlebar->isChecked());
settings->save();
}
m_editableUrl->setChecked(GeneralSettings::editableUrl());
m_showFullPath->setChecked(GeneralSettings::showFullPath());
m_filterBar->setChecked(GeneralSettings::filterBar());
+ m_showFullPathInTitlebar->setChecked(GeneralSettings::showFullPathInTitlebar());
}
QCheckBox* m_editableUrl;
QCheckBox* m_showFullPath;
QCheckBox* m_filterBar;
+ QCheckBox* m_showFullPathInTitlebar;
};
#endif
visibleRoles.clear();
visibleRoles.append("text");
visibleRoles.append("size");
- visibleRoles.append("date");
+ visibleRoles.append("modificationtime");
m_viewProps->setVisibleRoles(visibleRoles);
}
QVERIFY(itemsInsertedSpy.wait());
QCOMPARE(m_model->count(), 3);
- QCOMPARE(m_model->data(0)["text"].toString(), QString("a.txt"));
- QCOMPARE(m_model->data(1)["text"].toString(), QString("b.txt"));
- QCOMPARE(m_model->data(2)["text"].toString(), QString("c.txt"));
+ QCOMPARE(m_model->data(0).value("text").toString(), QString("a.txt"));
+ QCOMPARE(m_model->data(1).value("text").toString(), QString("b.txt"));
+ QCOMPARE(m_model->data(2).value("text").toString(), QString("c.txt"));
}
void KFileItemModelTest::testDefaultGroupedSorting()
// Sort by Date, descending
m_model->setSortDirectoriesFirst(true);
- m_model->setSortRole("date");
- QCOMPARE(m_model->sortRole(), QByteArray("date"));
+ m_model->setSortRole("modificationtime");
+ QCOMPARE(m_model->sortRole(), QByteArray("modificationtime"));
QCOMPARE(m_model->sortOrder(), Qt::DescendingOrder);
QCOMPARE(itemsInModel(), QStringList() << "c" << "c-2" << "c-3" << "c-1" << "b" << "d" << "a" << "e");
QCOMPARE(itemsMovedSpy.count(), 1);
// Sort by Date, ascending
m_model->setSortOrder(Qt::AscendingOrder);
- QCOMPARE(m_model->sortRole(), QByteArray("date"));
+ QCOMPARE(m_model->sortRole(), QByteArray("modificationtime"));
QCOMPARE(m_model->sortOrder(), Qt::AscendingOrder);
QCOMPARE(itemsInModel(), QStringList() << "c" << "c-2" << "c-3" << "c-1" << "e" << "a" << "d" << "b");
QCOMPARE(itemsMovedSpy.count(), 1);
// Sort by Date, ascending, 'Sort Folders First' disabled
m_model->setSortDirectoriesFirst(false);
- QCOMPARE(m_model->sortRole(), QByteArray("date"));
+ QCOMPARE(m_model->sortRole(), QByteArray("modificationtime"));
QCOMPARE(m_model->sortOrder(), Qt::AscendingOrder);
QVERIFY(!m_model->sortDirectoriesFirst());
QCOMPARE(itemsInModel(), QStringList() << "e" << "a" << "c" << "c-1" << "c-2" << "c-3" << "d" << "b");
*/
class KItemListControllerTestStyle : public QProxyStyle
{
+ Q_OBJECT
public:
KItemListControllerTestStyle(QStyle* style) :
QProxyStyle(style),
class DummyModel : public KItemModelBase
{
+ Q_OBJECT
public:
DummyModel();
void setCount(int count);
- virtual int count() const;
- virtual QHash<QByteArray, QVariant> data(int index) const;
+ int count() const Q_DECL_OVERRIDE;
+ QHash<QByteArray, QVariant> data(int index) const Q_DECL_OVERRIDE;
private:
int m_count;
#include <QTest>
#include <QVector>
-Q_DECLARE_METATYPE(KItemRangeList);
+Q_DECLARE_METATYPE(KItemRangeList)
/**
* Converts a KItemRangeList to a KItemSet.
static QSet<int> KItemSet2QSet(const KItemSet& itemSet)
{
QSet<int> result;
- foreach (int i, itemSet) {
+ for (int i : itemSet) {
result.insert(i);
}
// Check that the conversion was successful.
Q_ASSERT(itemSet.count() == result.count());
- foreach (int i, itemSet) {
+ for (int i : itemSet) {
Q_ASSERT(result.contains(i));
}
QCOMPARE(testQVector, itemsQVector);
testQVector.clear();
- foreach (int i, itemSet) {
+ for (int i : itemSet) {
testQVector.append(i);
}
QCOMPARE(testQVector, itemsQVector);
{
m_globalViewProps = GeneralSettings::self()->globalViewProps();
GeneralSettings::self()->setGlobalViewProps(false);
+ GeneralSettings::self()->save();
// It is mandatory to create the test-directory inside the home-directory
// of the user: ViewProperties does not write inside directories
m_testDir = 0;
GeneralSettings::self()->setGlobalViewProps(m_globalViewProps);
+ GeneralSettings::self()->save();
}
/**
KIO::Job * job = KIO::moveAs(oldUrl, newUrl);
KJobWidgets::setWindow(job, this);
KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job);
- job->ui()->setAutoErrorHandlingEnabled(true);
+ job->uiDelegate()->setAutoErrorHandlingEnabled(true);
if (!newNameExistsAlready) {
// Only connect the result signal if there is no item with the new name
KIO::Job * job = KIO::moveAs(oldUrl, newUrl);
KJobWidgets::setWindow(job, widget);
KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job);
- job->ui()->setAutoErrorHandlingEnabled(true);
+ job->uiDelegate()->setAutoErrorHandlingEnabled(true);
}
void RenameDialog::slotAccepted()
KIO::PreviewJob* job = new KIO::PreviewJob(KFileItemList() << m_item, QSize(256, 256));
job->setIgnoreMaximumSize(m_item.isLocalFile());
- if (job->ui()) {
+ if (job->uiDelegate()) {
KJobWidgets::setWindow(job, qApp->activeWindow());
}
Type=ServiceType
X-KDE-ServiceType=FileViewVersionControlPlugin
Comment=Version Control Plugin for File Views
-Comment[ast]=Complementu de control de versiones pa vistes de ficheros
Comment[ca]=Connector de control de versions per a les vistes de fitxers
Comment[ca@valencia]=Connector de control de versions per a les vistes de fitxers
Comment[cs]=Modul pro správu verzí pro pohledy na soubory
namespace {
const int AdditionalInfoViewPropertiesVersion = 1;
const int NameRolePropertiesVersion = 2;
- const int CurrentViewPropertiesVersion = 3;
+ const int DateRolePropertiesVersion = 4;
+ const int CurrentViewPropertiesVersion = 4;
// String representation to mark the additional properties of
// the details view as customized by the user. See
Q_ASSERT(m_node->version() == NameRolePropertiesVersion);
}
+ if (m_node->version() < DateRolePropertiesVersion) {
+ convertDateRoleToModificationTimeRole();
+ Q_ASSERT(m_node->version() == DateRolePropertiesVersion);
+ }
+
m_node->setVersion(CurrentViewPropertiesVersion);
}
}
&& !visibleRoles.contains(CustomizedDetailsString);
if (useDefaultValues) {
roles.append("size");
- roles.append("date");
+ roles.append("modificationtime");
}
return roles;
update();
}
+void ViewProperties::convertDateRoleToModificationTimeRole()
+{
+ QStringList visibleRoles = m_node->visibleRoles();
+ for (int i = 0; i < visibleRoles.count(); ++i) {
+ if (visibleRoles[i].endsWith(QLatin1String("_date"))) {
+ const int leftLength = visibleRoles[i].length() - 5;
+ visibleRoles[i] = visibleRoles[i].left(leftLength) + "_modificationtime";
+ }
+ }
+
+ QString sortRole = m_node->sortRole();
+ if (sortRole == QLatin1String("date")) {
+ sortRole = QStringLiteral("modificationtime");
+ }
+
+ m_node->setVisibleRoles(visibleRoles);
+ m_node->setSortRole(sortRole);
+ m_node->setVersion(DateRolePropertiesVersion);
+ update();
+}
+
bool ViewProperties::isPartOfHome(const QString& filePath)
{
// For performance reasons cache the path in a static QString
*/
void convertNameRoleToTextRole();
+ /**
+ * Provides backward compatibility with .directory files created with
+ * Dolphin < 16.11.70: Converts the old name-role "date" to "modificationtime"
+ */
+
+ void convertDateRoleToModificationTimeRole();
/**
* Returns true, if \a filePath is part of the home-path (see QDir::homePath()).
*/