mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
kdelibs4support--
This commit is contained in:
parent
a705337fab
commit
5c1420fec9
|
@ -31,7 +31,8 @@
|
||||||
DolphinApplication::DolphinApplication() :
|
DolphinApplication::DolphinApplication() :
|
||||||
m_mainWindow(0)
|
m_mainWindow(0)
|
||||||
{
|
{
|
||||||
KGlobal::locale()->insertCatalog("libkonq"); // Needed for applications using libkonq
|
//KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
|
||||||
|
//KLocale::global()->insertCatalog("libkonq"); // Needed for applications using libkonq
|
||||||
|
|
||||||
m_mainWindow = new DolphinMainWindow();
|
m_mainWindow = new DolphinMainWindow();
|
||||||
m_mainWindow->setAttribute(Qt::WA_DeleteOnClose);
|
m_mainWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
|
|
@ -397,7 +397,7 @@ void DolphinContextMenu::insertDefaultItemActions(const KFileItemListProperties&
|
||||||
|
|
||||||
// Insert 'Move to Trash' and/or 'Delete'
|
// Insert 'Move to Trash' and/or 'Delete'
|
||||||
if (properties.supportsDeleting()) {
|
if (properties.supportsDeleting()) {
|
||||||
const bool showDeleteAction = (KGlobal::config()->group("KDE").readEntry("ShowDeleteCommand", false) ||
|
const bool showDeleteAction = (KSharedConfig::openConfig()->group("KDE").readEntry("ShowDeleteCommand", false) ||
|
||||||
!properties.isLocal());
|
!properties.isLocal());
|
||||||
const bool showMoveToTrashAction = (properties.isLocal() &&
|
const bool showMoveToTrashAction = (properties.isLocal() &&
|
||||||
properties.supportsMoving());
|
properties.supportsMoving());
|
||||||
|
|
|
@ -417,7 +417,7 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event)
|
||||||
}
|
}
|
||||||
|
|
||||||
GeneralSettings::setVersion(CurrentDolphinVersion);
|
GeneralSettings::setVersion(CurrentDolphinVersion);
|
||||||
GeneralSettings::self()->writeConfig();
|
GeneralSettings::self()->save();
|
||||||
|
|
||||||
KXmlGuiWindow::closeEvent(event);
|
KXmlGuiWindow::closeEvent(event);
|
||||||
}
|
}
|
||||||
|
|
|
@ -430,7 +430,7 @@ void DolphinPart::slotOpenContextMenu(const QPoint& pos,
|
||||||
const bool supportsMoving = capabilities.supportsMoving();
|
const bool supportsMoving = capabilities.supportsMoving();
|
||||||
|
|
||||||
if (capabilities.supportsDeleting()) {
|
if (capabilities.supportsDeleting()) {
|
||||||
const bool showDeleteAction = (KGlobal::config()->group("KDE").readEntry("ShowDeleteCommand", false) ||
|
const bool showDeleteAction = (KSharedConfig::openConfig()->group("KDE").readEntry("ShowDeleteCommand", false) ||
|
||||||
!item.isLocalFile());
|
!item.isLocalFile());
|
||||||
const bool showMoveToTrashAction = capabilities.isLocal() && supportsMoving;
|
const bool showMoveToTrashAction = capabilities.isLocal() && supportsMoving;
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
#include <KLocale>
|
#include <KLocale>
|
||||||
#include <KIO/MetaData>
|
#include <KIO/MetaData>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
#include <KFormat>
|
||||||
|
#include <QMimeDatabase>
|
||||||
|
|
||||||
KFileItemListWidgetInformant::KFileItemListWidgetInformant() :
|
KFileItemListWidgetInformant::KFileItemListWidgetInformant() :
|
||||||
KStandardItemListWidgetInformant()
|
KStandardItemListWidgetInformant()
|
||||||
|
@ -78,11 +80,11 @@ QString KFileItemListWidgetInformant::roleText(const QByteArray& role,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const KIO::filesize_t size = roleValue.value<KIO::filesize_t>();
|
const KIO::filesize_t size = roleValue.value<KIO::filesize_t>();
|
||||||
text = KGlobal::locale()->formatByteSize(size);
|
text = KFormat().formatByteSize(size);
|
||||||
}
|
}
|
||||||
} else if (role == "date") {
|
} else if (role == "date") {
|
||||||
const QDateTime dateTime = roleValue.toDateTime();
|
const QDateTime dateTime = roleValue.toDateTime();
|
||||||
text = KGlobal::locale()->formatDateTime(dateTime);
|
text = KLocale::global()->formatDateTime(dateTime);
|
||||||
} else {
|
} else {
|
||||||
text = KStandardItemListWidgetInformant::roleText(role, values);
|
text = KStandardItemListWidgetInformant::roleText(role, values);
|
||||||
}
|
}
|
||||||
|
@ -142,7 +144,8 @@ int KFileItemListWidget::selectionLength(const QString& text) const
|
||||||
return selectionLength;
|
return selectionLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString extension = KMimeType::extractKnownExtension(text);
|
QMimeDatabase db;
|
||||||
|
const QString extension = db.suffixForFileName(text);
|
||||||
if (extension.isEmpty()) {
|
if (extension.isEmpty()) {
|
||||||
// For an unknown extension just exclude the extension after
|
// For an unknown extension just exclude the extension after
|
||||||
// the last point. This does not work for multiple extensions like
|
// the last point. This does not work for multiple extensions like
|
||||||
|
|
|
@ -97,7 +97,7 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel* model, QO
|
||||||
{
|
{
|
||||||
Q_ASSERT(model);
|
Q_ASSERT(model);
|
||||||
|
|
||||||
const KConfigGroup globalConfig(KGlobal::config(), "PreviewSettings");
|
const KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings");
|
||||||
m_enabledPlugins = globalConfig.readEntry("Plugins", QStringList()
|
m_enabledPlugins = globalConfig.readEntry("Plugins", QStringList()
|
||||||
<< "directorythumbnail"
|
<< "directorythumbnail"
|
||||||
<< "imagethumbnail"
|
<< "imagethumbnail"
|
||||||
|
|
|
@ -61,7 +61,7 @@ FoldersPanel::FoldersPanel(QWidget* parent) :
|
||||||
|
|
||||||
FoldersPanel::~FoldersPanel()
|
FoldersPanel::~FoldersPanel()
|
||||||
{
|
{
|
||||||
FoldersPanelSettings::self()->writeConfig();
|
FoldersPanelSettings::self()->save();
|
||||||
|
|
||||||
if (m_controller) {
|
if (m_controller) {
|
||||||
KItemListView* view = m_controller->view();
|
KItemListView* view = m_controller->view();
|
||||||
|
|
|
@ -159,7 +159,7 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) :
|
||||||
|
|
||||||
InformationPanelContent::~InformationPanelContent()
|
InformationPanelContent::~InformationPanelContent()
|
||||||
{
|
{
|
||||||
InformationPanelSettings::self()->writeConfig();
|
InformationPanelSettings::self()->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
void InformationPanelContent::showItem(const KFileItem& item)
|
void InformationPanelContent::showItem(const KFileItem& item)
|
||||||
|
|
|
@ -70,7 +70,7 @@ void TerminalPanel::dockVisibilityChanged()
|
||||||
this, SLOT(slotKonsolePartCurrentDirectoryChanged(QString)));
|
this, SLOT(slotKonsolePartCurrentDirectoryChanged(QString)));
|
||||||
|
|
||||||
// Make sure this terminal does not prevent unmounting any removable drives
|
// Make sure this terminal does not prevent unmounting any removable drives
|
||||||
changeDir(KUrl::fromPath("/"));
|
changeDir(QUrl::fromLocalFile("/"));
|
||||||
|
|
||||||
// Because we have disconnected from the part's currentDirectoryChanged()
|
// Because we have disconnected from the part's currentDirectoryChanged()
|
||||||
// signal, we have to update m_konsolePartCurrentDirectory manually. If this
|
// signal, we have to update m_konsolePartCurrentDirectory manually. If this
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
#include <Baloo/Query>
|
#include <Baloo/Query>
|
||||||
#include <Baloo/Term>
|
#include <Baloo/Term>
|
||||||
#include <Baloo/IndexerConfig>
|
#include <Baloo/IndexerConfig>
|
||||||
|
#include <QFontDatabase>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DolphinSearchBox::DolphinSearchBox(QWidget* parent) :
|
DolphinSearchBox::DolphinSearchBox(QWidget* parent) :
|
||||||
|
@ -324,7 +325,7 @@ void DolphinSearchBox::saveSettings()
|
||||||
SearchSettings::setLocation(m_fromHereButton->isChecked() ? "FromHere" : "Everywhere");
|
SearchSettings::setLocation(m_fromHereButton->isChecked() ? "FromHere" : "Everywhere");
|
||||||
SearchSettings::setWhat(m_fileNameButton->isChecked() ? "FileName" : "Content");
|
SearchSettings::setWhat(m_fileNameButton->isChecked() ? "FileName" : "Content");
|
||||||
SearchSettings::setShowFacetsWidget(m_facetsToggleButton->isChecked());
|
SearchSettings::setShowFacetsWidget(m_facetsToggleButton->isChecked());
|
||||||
SearchSettings::self()->writeConfig();
|
SearchSettings::self()->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DolphinSearchBox::init()
|
void DolphinSearchBox::init()
|
||||||
|
@ -351,7 +352,7 @@ void DolphinSearchBox::init()
|
||||||
m_searchInput = new KLineEdit(this);
|
m_searchInput = new KLineEdit(this);
|
||||||
m_searchInput->installEventFilter(this);
|
m_searchInput->installEventFilter(this);
|
||||||
m_searchInput->setClearButtonShown(true);
|
m_searchInput->setClearButtonShown(true);
|
||||||
m_searchInput->setFont(KGlobalSettings::generalFont());
|
m_searchInput->setFont(QFontDatabase::systemFont(QFontDatabase::GeneralFont));
|
||||||
connect(m_searchInput, &KLineEdit::returnPressed,
|
connect(m_searchInput, &KLineEdit::returnPressed,
|
||||||
this, &DolphinSearchBox::slotReturnPressed);
|
this, &DolphinSearchBox::slotReturnPressed);
|
||||||
connect(m_searchInput, &KLineEdit::textChanged,
|
connect(m_searchInput, &KLineEdit::textChanged,
|
||||||
|
|
|
@ -119,7 +119,7 @@ void PreviewsSettingsPage::applySettings()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
KConfigGroup globalConfig(KGlobal::config(), QLatin1String("PreviewSettings"));
|
KConfigGroup globalConfig(KSharedConfig::openConfig(), QLatin1String("PreviewSettings"));
|
||||||
globalConfig.writeEntry("Plugins", m_enabledPreviewPlugins);
|
globalConfig.writeEntry("Plugins", m_enabledPreviewPlugins);
|
||||||
|
|
||||||
const qulonglong maximumRemoteSize = static_cast<qulonglong>(m_remoteFileSizeBox->value()) * 1024 * 1024;
|
const qulonglong maximumRemoteSize = static_cast<qulonglong>(m_remoteFileSizeBox->value()) * 1024 * 1024;
|
||||||
|
@ -176,7 +176,7 @@ void PreviewsSettingsPage::loadPreviewPlugins()
|
||||||
|
|
||||||
void PreviewsSettingsPage::loadSettings()
|
void PreviewsSettingsPage::loadSettings()
|
||||||
{
|
{
|
||||||
KConfigGroup globalConfig(KGlobal::config(), "PreviewSettings");
|
KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings");
|
||||||
m_enabledPreviewPlugins = globalConfig.readEntry("Plugins", QStringList()
|
m_enabledPreviewPlugins = globalConfig.readEntry("Plugins", QStringList()
|
||||||
<< QLatin1String("directorythumbnail")
|
<< QLatin1String("directorythumbnail")
|
||||||
<< QLatin1String("imagethumbnail")
|
<< QLatin1String("imagethumbnail")
|
||||||
|
|
|
@ -42,7 +42,8 @@ DolphinGeneralConfigModule::DolphinGeneralConfigModule(QWidget* parent, const QV
|
||||||
{
|
{
|
||||||
Q_UNUSED(args);
|
Q_UNUSED(args);
|
||||||
|
|
||||||
KGlobal::locale()->insertCatalog("dolphin");
|
//KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
|
||||||
|
//KLocale::global()->insertCatalog("dolphin");
|
||||||
|
|
||||||
setButtons(KCModule::Default | KCModule::Help);
|
setButtons(KCModule::Default | KCModule::Help);
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,8 @@ DolphinNavigationConfigModule::DolphinNavigationConfigModule(QWidget* parent, co
|
||||||
{
|
{
|
||||||
Q_UNUSED(args);
|
Q_UNUSED(args);
|
||||||
|
|
||||||
KGlobal::locale()->insertCatalog("dolphin");
|
//KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
|
||||||
|
//KLocale::global()->insertCatalog("dolphin");
|
||||||
|
|
||||||
setButtons(KCModule::Default | KCModule::Help);
|
setButtons(KCModule::Default | KCModule::Help);
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,8 @@ DolphinServicesConfigModule::DolphinServicesConfigModule(QWidget* parent, const
|
||||||
{
|
{
|
||||||
Q_UNUSED(args);
|
Q_UNUSED(args);
|
||||||
|
|
||||||
KGlobal::locale()->insertCatalog("dolphin");
|
//KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
|
||||||
|
//KLocale::global()->insertCatalog("dolphin");
|
||||||
|
|
||||||
setButtons(KCModule::Default | KCModule::Help);
|
setButtons(KCModule::Default | KCModule::Help);
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,8 @@ DolphinViewModesConfigModule::DolphinViewModesConfigModule(QWidget* parent, cons
|
||||||
{
|
{
|
||||||
Q_UNUSED(args);
|
Q_UNUSED(args);
|
||||||
|
|
||||||
KGlobal::locale()->insertCatalog("dolphin");
|
//KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
|
||||||
|
//KLocale::global()->insertCatalog("dolphin");
|
||||||
|
|
||||||
setButtons(KCModule::Default | KCModule::Help);
|
setButtons(KCModule::Default | KCModule::Help);
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ void ServicesSettingsPage::applySettings()
|
||||||
configGroup.sync();
|
configGroup.sync();
|
||||||
} else if (service == QLatin1String(CopyToMoveToService)) {
|
} else if (service == QLatin1String(CopyToMoveToService)) {
|
||||||
GeneralSettings::setShowCopyMoveMenu(checked);
|
GeneralSettings::setShowCopyMoveMenu(checked);
|
||||||
GeneralSettings::self()->writeConfig();
|
GeneralSettings::self()->save();
|
||||||
} else {
|
} else {
|
||||||
showGroup.writeEntry(service, checked);
|
showGroup.writeEntry(service, checked);
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ void ServicesSettingsPage::applySettings()
|
||||||
|
|
||||||
if (m_enabledVcsPlugins != enabledPlugins) {
|
if (m_enabledVcsPlugins != enabledPlugins) {
|
||||||
VersionControlSettings::setEnabledPlugins(enabledPlugins);
|
VersionControlSettings::setEnabledPlugins(enabledPlugins);
|
||||||
VersionControlSettings::self()->writeConfig();
|
VersionControlSettings::self()->save();
|
||||||
|
|
||||||
KMessageBox::information(window(),
|
KMessageBox::information(window(),
|
||||||
i18nc("@info", "Dolphin must be restarted to apply the "
|
i18nc("@info", "Dolphin must be restarted to apply the "
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
#include <QFontDatabase>
|
||||||
|
|
||||||
DolphinFontRequester::DolphinFontRequester(QWidget* parent) :
|
DolphinFontRequester::DolphinFontRequester(QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
|
@ -72,7 +73,7 @@ DolphinFontRequester::Mode DolphinFontRequester::mode() const
|
||||||
|
|
||||||
QFont DolphinFontRequester::currentFont() const
|
QFont DolphinFontRequester::currentFont() const
|
||||||
{
|
{
|
||||||
return (m_mode == CustomFont) ? m_customFont : KGlobalSettings::generalFont();
|
return (m_mode == CustomFont) ? m_customFont : QFontDatabase::systemFont(QFontDatabase::GeneralFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DolphinFontRequester::setCustomFont(const QFont& font)
|
void DolphinFontRequester::setCustomFont(const QFont& font)
|
||||||
|
|
|
@ -125,9 +125,9 @@ int ViewModeSettings::fontWeight() const
|
||||||
void ViewModeSettings::readConfig()
|
void ViewModeSettings::readConfig()
|
||||||
{
|
{
|
||||||
switch (m_mode) {
|
switch (m_mode) {
|
||||||
case ViewModeSettings::IconsMode: IconsModeSettings::self()->readConfig(); break;
|
case ViewModeSettings::IconsMode: IconsModeSettings::self()->load(); break;
|
||||||
case ViewModeSettings::CompactMode: CompactModeSettings::self()->readConfig(); break;
|
case ViewModeSettings::CompactMode: CompactModeSettings::self()->load(); break;
|
||||||
case ViewModeSettings::DetailsMode: DetailsModeSettings::self()->readConfig(); break;
|
case ViewModeSettings::DetailsMode: DetailsModeSettings::self()->load(); break;
|
||||||
default: Q_ASSERT(false); break;
|
default: Q_ASSERT(false); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,9 +135,9 @@ void ViewModeSettings::readConfig()
|
||||||
void ViewModeSettings::writeConfig()
|
void ViewModeSettings::writeConfig()
|
||||||
{
|
{
|
||||||
switch (m_mode) {
|
switch (m_mode) {
|
||||||
case ViewModeSettings::IconsMode: IconsModeSettings::self()->writeConfig(); break;
|
case ViewModeSettings::IconsMode: IconsModeSettings::self()->save(); break;
|
||||||
case ViewModeSettings::CompactMode: CompactModeSettings::self()->writeConfig(); break;
|
case ViewModeSettings::CompactMode: CompactModeSettings::self()->save(); break;
|
||||||
case ViewModeSettings::DetailsMode: DetailsModeSettings::self()->writeConfig(); break;
|
case ViewModeSettings::DetailsMode: DetailsModeSettings::self()->save(); break;
|
||||||
default: Q_ASSERT(false); break;
|
default: Q_ASSERT(false); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,7 @@ void DolphinItemListView::readSettings()
|
||||||
updateFont();
|
updateFont();
|
||||||
updateGridSize();
|
updateGridSize();
|
||||||
|
|
||||||
const KConfigGroup globalConfig(KGlobal::config(), "PreviewSettings");
|
const KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings");
|
||||||
const QStringList plugins = globalConfig.readEntry("Plugins", QStringList()
|
const QStringList plugins = globalConfig.readEntry("Plugins", QStringList()
|
||||||
<< "directorythumbnail"
|
<< "directorythumbnail"
|
||||||
<< "imagethumbnail"
|
<< "imagethumbnail"
|
||||||
|
@ -107,9 +107,9 @@ void DolphinItemListView::readSettings()
|
||||||
|
|
||||||
void DolphinItemListView::writeSettings()
|
void DolphinItemListView::writeSettings()
|
||||||
{
|
{
|
||||||
IconsModeSettings::self()->writeConfig();
|
IconsModeSettings::self()->save();
|
||||||
CompactModeSettings::self()->writeConfig();
|
CompactModeSettings::self()->save();
|
||||||
DetailsModeSettings::self()->writeConfig();
|
DetailsModeSettings::self()->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
KItemListWidgetCreatorBase* DolphinItemListView::defaultWidgetCreator() const
|
KItemListWidgetCreatorBase* DolphinItemListView::defaultWidgetCreator() const
|
||||||
|
|
|
@ -70,7 +70,7 @@ void DolphinRemoteEncoding::slotReload()
|
||||||
void DolphinRemoteEncoding::loadSettings()
|
void DolphinRemoteEncoding::loadSettings()
|
||||||
{
|
{
|
||||||
m_loaded = true;
|
m_loaded = true;
|
||||||
m_encodingDescriptions = KGlobal::charsets()->descriptiveEncodingNames();
|
m_encodingDescriptions = KCharsets::charsets()->descriptiveEncodingNames();
|
||||||
|
|
||||||
fillMenu();
|
fillMenu();
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,7 @@ void DolphinRemoteEncoding::updateMenu()
|
||||||
m_menu->menu()->actions().at(i)->setChecked(false);
|
m_menu->menu()->actions().at(i)->setChecked(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString charset = KGlobal::charsets()->descriptionForEncoding(KProtocolManager::charsetFor(m_currentURL));
|
const QString charset = KCharsets::charsets()->descriptionForEncoding(KProtocolManager::charsetFor(m_currentURL));
|
||||||
if (!charset.isEmpty()) {
|
if (!charset.isEmpty()) {
|
||||||
int id = 0;
|
int id = 0;
|
||||||
bool isFound = false;
|
bool isFound = false;
|
||||||
|
@ -172,7 +172,7 @@ void DolphinRemoteEncoding::slotItemSelected(QAction* action)
|
||||||
KConfig config(("kio_" + m_currentURL.protocol() + "rc").toLatin1());
|
KConfig config(("kio_" + m_currentURL.protocol() + "rc").toLatin1());
|
||||||
QString host = m_currentURL.host();
|
QString host = m_currentURL.host();
|
||||||
if (m_menu->menu()->actions().at(id)->isChecked()) {
|
if (m_menu->menu()->actions().at(id)->isChecked()) {
|
||||||
QString charset = KGlobal::charsets()->encodingForName(m_encodingDescriptions.at(id));
|
QString charset = KCharsets::charsets()->encodingForName(m_encodingDescriptions.at(id));
|
||||||
KConfigGroup cg(&config, host);
|
KConfigGroup cg(&config, host);
|
||||||
cg.writeEntry(DATA_KEY, charset);
|
cg.writeEntry(DATA_KEY, charset);
|
||||||
config.sync();
|
config.sync();
|
||||||
|
|
|
@ -80,6 +80,7 @@
|
||||||
|
|
||||||
#ifdef HAVE_BALOO
|
#ifdef HAVE_BALOO
|
||||||
#include <Baloo/IndexerConfig>
|
#include <Baloo/IndexerConfig>
|
||||||
|
#include <KFormat>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -489,7 +490,7 @@ void DolphinView::readSettings()
|
||||||
{
|
{
|
||||||
const int oldZoomLevel = m_view->zoomLevel();
|
const int oldZoomLevel = m_view->zoomLevel();
|
||||||
|
|
||||||
GeneralSettings::self()->readConfig();
|
GeneralSettings::self()->load();
|
||||||
m_view->readSettings();
|
m_view->readSettings();
|
||||||
applyViewProperties();
|
applyViewProperties();
|
||||||
|
|
||||||
|
@ -504,7 +505,7 @@ void DolphinView::readSettings()
|
||||||
|
|
||||||
void DolphinView::writeSettings()
|
void DolphinView::writeSettings()
|
||||||
{
|
{
|
||||||
GeneralSettings::self()->writeConfig();
|
GeneralSettings::self()->save();
|
||||||
m_view->writeSettings();
|
m_view->writeSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -567,11 +568,11 @@ QString DolphinView::statusBarText() const
|
||||||
if (fileCount > 0 && folderCount > 0) {
|
if (fileCount > 0 && folderCount > 0) {
|
||||||
summary = i18nc("@info:status folders, files (size)", "%1, %2 (%3)",
|
summary = i18nc("@info:status folders, files (size)", "%1, %2 (%3)",
|
||||||
foldersText, filesText,
|
foldersText, filesText,
|
||||||
KGlobal::locale()->formatByteSize(totalFileSize));
|
KFormat().formatByteSize(totalFileSize));
|
||||||
} else if (fileCount > 0) {
|
} else if (fileCount > 0) {
|
||||||
summary = i18nc("@info:status files (size)", "%1 (%2)",
|
summary = i18nc("@info:status files (size)", "%1 (%2)",
|
||||||
filesText,
|
filesText,
|
||||||
KGlobal::locale()->formatByteSize(totalFileSize));
|
KFormat().formatByteSize(totalFileSize));
|
||||||
} else if (folderCount > 0) {
|
} else if (folderCount > 0) {
|
||||||
summary = foldersText;
|
summary = foldersText;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
#include <QMimeDatabase>
|
||||||
|
|
||||||
RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
|
RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
|
||||||
KDialog(parent),
|
KDialog(parent),
|
||||||
|
@ -83,7 +84,8 @@ RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
|
||||||
int selectionLength = m_newName.length();
|
int selectionLength = m_newName.length();
|
||||||
if (m_renameOneItem) {
|
if (m_renameOneItem) {
|
||||||
const QString fileName = items.first().url().toDisplayString();
|
const QString fileName = items.first().url().toDisplayString();
|
||||||
const QString extension = KMimeType::extractKnownExtension(fileName.toLower());
|
QMimeDatabase db;
|
||||||
|
const QString extension = db.suffixForFileName(fileName.toLower());
|
||||||
|
|
||||||
// If the current item is a directory, select the whole file name.
|
// If the current item is a directory, select the whole file name.
|
||||||
if ((extension.length() > 0) && !items.first().isDir()) {
|
if ((extension.length() > 0) && !items.first().isDir()) {
|
||||||
|
@ -105,7 +107,8 @@ RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
|
||||||
if (!m_renameOneItem) {
|
if (!m_renameOneItem) {
|
||||||
QSet<QString> extensions;
|
QSet<QString> extensions;
|
||||||
foreach (const KFileItem& item, m_items) {
|
foreach (const KFileItem& item, m_items) {
|
||||||
const QString extension = KMimeType::extractKnownExtension(item.url().toDisplayString().toLower());
|
QMimeDatabase db;
|
||||||
|
const QString extension = db.suffixForFileName(item.url().toDisplayString().toLower());
|
||||||
|
|
||||||
if (extensions.contains(extension)) {
|
if (extensions.contains(extension)) {
|
||||||
m_allExtensionsDifferent = false;
|
m_allExtensionsDifferent = false;
|
||||||
|
@ -191,7 +194,8 @@ void RenameDialog::renameItems()
|
||||||
++index;
|
++index;
|
||||||
|
|
||||||
const QUrl oldUrl = item.url();
|
const QUrl oldUrl = item.url();
|
||||||
const QString extension = KMimeType::extractKnownExtension(oldUrl.path().toLower());
|
QMimeDatabase db;
|
||||||
|
const QString extension = db.suffixForFileName(oldUrl.path().toLower());
|
||||||
if (!extension.isEmpty()) {
|
if (!extension.isEmpty()) {
|
||||||
newName.append(QLatin1Char('.'));
|
newName.append(QLatin1Char('.'));
|
||||||
newName.append(extension);
|
newName.append(extension);
|
||||||
|
|
Loading…
Reference in a new issue