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