Commit 0fbf542c authored by Laurent Montel's avatar Laurent Montel 😁

Remove kdelibs4support

parent 8245bc4e
......@@ -335,7 +335,7 @@ void AutoPasteModel::save()
Settings::self()->setAutoPasteTypes(types);
Settings::self()->setAutoPastePatternSyntaxes(syntaxes);
Settings::self()->setAutoPastePatterns(patterns);
Settings::self()->writeConfig();
Settings::self()->save();
}
void AutoPasteModel::resetDefaults()
......
......@@ -164,7 +164,7 @@
<default>true</default>
</entry>
<entry name="LastDirectory" type="Path">
<default code="true">KGlobalSettings::downloadPath()</default>
<default code="true">QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)</default>
</entry>
<entry name="LastGroup" type="String">
</entry>
......
......@@ -24,7 +24,7 @@ PluginSelector::PluginSelector(QDialog * parent)
KService::List offers = KServiceTypeTrader::self()->query("KGet/Plugin");
//TODO: POrt this
//addPlugins(KPluginInfo::fromServices(offers), KPluginSelector::ReadConfigFile, i18n("Plugins"), "Service", KGlobal::config());
//addPlugins(KPluginInfo::fromServices(offers), KPluginSelector::ReadConfigFile, i18n("Plugins"), "Service", KSharedConfig::openConfig());
load();
......
......@@ -51,7 +51,7 @@ void VerificationPreferences::slotAccpeted()
ui.keyservers->lineEdit()->clear();
m_tempKeyServers = ui.keyservers->items();
Settings::self()->setSignatureKeyServers(m_tempKeyServers);
Settings::self()->writeConfig();
Settings::self()->save();
}
void VerificationPreferences::slotRejected()
......
......@@ -24,7 +24,7 @@ KGetSaveSizeDialog::KGetSaveSizeDialog(const QByteArray &name, QWidget *parent,
: KDialog(parent, flags),
m_name("Size" + name)
{
const QSize size;// = KGlobal::config()->group("Geometry").readEntry(m_name.constData(), QSize()); //TODO: Port this file
const QSize size;// = KSharedConfig::openConfig()->group("Geometry").readEntry(m_name.constData(), QSize()); //TODO: Port this file
if (size.isValid()) {
resize(size);
}
......@@ -33,6 +33,6 @@ KGetSaveSizeDialog::KGetSaveSizeDialog(const QByteArray &name, QWidget *parent,
KGetSaveSizeDialog::~KGetSaveSizeDialog()
{
const QString name = QString("Size_") + metaObject()->className();
//KGlobal::config()->group("Geometry").writeEntry(m_name.constData(), size());
//KSharedConfig::openConfig()->group("Geometry").writeEntry(m_name.constData(), size());
}
......@@ -63,6 +63,7 @@
#include <QDBusPendingCall>
#include <kworkspace/kworkspace.h>
#include <solid/powermanagement.h>
#include <QStandardPaths>
#endif
......@@ -946,7 +947,7 @@ QString KGet::generalDestDir(bool preferXDGDownloadDir)
QString dir = Settings::lastDirectory();
if (preferXDGDownloadDir) {
dir = KGlobalSettings::downloadPath();
dir = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
}
return dir;
......@@ -1175,7 +1176,7 @@ void KGet::loadPlugins()
//members of this class (why?), such as the m_transferFactories list.
QList<KGetPlugin *> pluginList;
/*const KConfigGroup plugins = KConfigGroup(KGlobal::config(), "Plugins");
/*const KConfigGroup plugins = KConfigGroup(KSharedConfig::openConfig(), "Plugins");
foreach (KService::Ptr service, services)
{
......
......@@ -139,10 +139,10 @@ void HttpServer::handleRequest()
if (map.at(0) == "action")
action = map.at(1);
else if (map.at(0) == "data")
data = KUrl::fromPercentEncoding(QByteArray(map.at(1).toUtf8()));
data = QUrl::fromPercentEncoding(QByteArray(map.at(1).toUtf8()));
// action specific parameters
else if (map.at(0) == "group")
group = KUrl::fromPercentEncoding(QByteArray(map.at(1).toUtf8()));
group = QUrl::fromPercentEncoding(QByteArray(map.at(1).toUtf8()));
}
kDebug(5001) << action << data << group;
if (action == "add") {
......
......@@ -107,7 +107,7 @@ MainWindow::~MainWindow()
// reset konqueror integration (necessary if user enabled / disabled temporarily integration from tray)
slotKonquerorIntegration( Settings::konquerorIntegration() );
// the following call saves options set in above dtors
Settings::self()->writeConfig();
Settings::self()->save();
delete m_drop;
delete m_kget;
......@@ -398,7 +398,7 @@ void MainWindow::slotDownloadFinishedActions()
//only after finish actions have a number assigned
Settings::self()->setAfterFinishActionEnabled(ok);
Settings::self()->writeConfig();
Settings::self()->save();
slotNewConfig();
}
......@@ -574,7 +574,7 @@ void MainWindow::slotQuit()
return;
}
Settings::self()->writeConfig();
Settings::self()->save();
qApp->quit();
}
......@@ -964,7 +964,7 @@ void MainWindow::slotSaveMyself()
// save last parameters ..
Settings::setMainPosition( pos() );
// .. and write config to disk
Settings::self()->writeConfig();
Settings::self()->save();
}
void MainWindow::slotNewToolbarConfig()
......
......@@ -138,7 +138,8 @@ KGetApplet::~KGetApplet()
void KGetApplet::init()
{
KGlobal::locale()->insertCatalog("plasma_applet_kget");
//KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
//KLocale::global()->insertCatalog("plasma_applet_kget");
setPopupIcon("kget");
m_engine = dataEngine("kget");
......
......@@ -168,7 +168,8 @@ KGetPanelBar::~KGetPanelBar()
void KGetPanelBar::init()
{
KGlobal::locale()->insertCatalog("plasma_applet_kget");
//KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
//KLocale::global()->insertCatalog("plasma_applet_kget");
m_icon = new Plasma::IconWidget(KIcon("go-down"), QString(), this);
......
......@@ -48,6 +48,7 @@
#include <plasma/dataengine.h>
#include <Plasma/Label>
#include <Plasma/ScrollWidget>
#include <KFormat>
const float KGetPieChart::PieChart::PIE_OPACITY = 0.67f;
const float KGetPieChart::PieChart::ACTIVE_PIE_OPACITY = 0.84f;
......@@ -173,7 +174,7 @@ KGetPieChart::Item::~Item()
void KGetPieChart::Item::setSize(KIO::filesize_t size)
{
m_sizeLabel->setText(KGlobal::locale()->formatByteSize(size));
m_sizeLabel->setText(KFormat().formatByteSize(size));
}
void KGetPieChart::Item::setName(const QString &name)
......
......@@ -59,7 +59,7 @@ void BTAdvancedDetailsWidget::init()
layout->addWidget(tabWidget);
setLayout(layout);
file_view = new FileView(this);
file_view->changeTC(tc, KGlobal::config());
file_view->changeTC(tc, KSharedConfig::openConfig());
tabWidget->insertTab(0, file_view, KIcon("inode-directory"), i18n("Files"));
//peer_view = new PeerView(this);
//tabWidget->insertTab(1, peer_view, KIcon("system-users"), i18n("Peers"));
......
......@@ -151,9 +151,9 @@ namespace kt
return QVariant();
case 4: return stats.choked ? i18nc("Choked", "Yes") : i18nc("Not choked", "No");
case 5: return stats.snubbed ? i18nc("Snubbed", "Yes") : i18nc("Not snubbed", "No");
case 6: return QString("%1 %").arg(KGlobal::locale()->formatNumber(stats.perc_of_file,2));
case 6: return QString("%1 %").arg(KLocale::global()->formatNumber(stats.perc_of_file,2));
case 7: return QVariant();
case 8: return KGlobal::locale()->formatNumber(stats.aca_score,2);
case 8: return KLocale::global()->formatNumber(stats.aca_score,2);
case 9: return QVariant();
case 10: return QString("%1 / %2").arg(stats.num_down_requests).arg(stats.num_up_requests);
case 11: return BytesToString(stats.bytes_downloaded);
......
......@@ -14,6 +14,7 @@
#include "ui_btdetailswidgetfrm.h"
#include <kdebug.h>
#include <KFormat>
BTDetailsWidget::BTDetailsWidget(BTTransferHandler * transfer)
: m_transfer(transfer)
......@@ -50,10 +51,10 @@ void BTDetailsWidget::slotTransferChanged(TransferHandler * transfer, TransferHa
kDebug(5001) << "BTDetailsWidget::slotTransferChanged";
if(flags & Transfer::Tc_DownloadSpeed)
dlSpeedLabel->setText(KGlobal::locale()->formatByteSize(m_transfer->downloadSpeed()) + "/s");
dlSpeedLabel->setText(KFormat().formatByteSize(m_transfer->downloadSpeed()) + "/s");
if(flags & Transfer::Tc_UploadSpeed)
ulSpeedLabel->setText(KGlobal::locale()->formatByteSize(m_transfer->uploadSpeed()) + "/s");
ulSpeedLabel->setText(KFormat().formatByteSize(m_transfer->uploadSpeed()) + "/s");
if(flags & BTTransfer::Tc_SeedsConnected)
seederLabel->setText((m_transfer->seedsConnected()!=-1 ? QString().setNum(m_transfer->seedsConnected()) : i18nc("not available", "n/a")) + " (" +
......
......@@ -51,7 +51,7 @@ void BTSettingsWidget::save()
BittorrentSettings::setPreAlloc(preallocBox->isChecked());
BittorrentSettings::setEnableUTP(utpBox->isChecked());
BittorrentSettings::self()->writeConfig();
BittorrentSettings::self()->save();
}
void BTSettingsWidget::defaults()
......
......@@ -282,7 +282,7 @@ void DlgChecksumSettingsWidget::save()
ChecksumSearchSettings::self()->setUrlChangeModeList(modes);
ChecksumSearchSettings::self()->setChecksumTypeList(types);
ChecksumSearchSettings::self()->writeConfig();
ChecksumSearchSettings::self()->save();
}
......@@ -201,7 +201,7 @@ void DlgContentFetchSettingWidget::saveContentFetchSetting()
ContentFetchSetting::self()->setDescriptionList(descriptions);
ContentFetchSetting::self()->setEnableList(enables);
ContentFetchSetting::self()->writeConfig();
ContentFetchSetting::self()->save();
}
void DlgContentFetchSettingWidget::save()
......
......@@ -35,7 +35,7 @@ DlgScriptEditing::DlgScriptEditing(QWidget *p_parent,
setMainWidget(mainWidget);
setWindowTitle(i18n("Edit Script"));
ui.scriptPathRequester->setUrl(KUrl::fromPath(script[0]));
ui.scriptPathRequester->setUrl(QUrl::fromLocalFile(script[0]));
ui.scriptUrlRegexpEdit->setText(script[1]);
ui.scriptDescriptionEdit->setText(script[2]);
......
......@@ -43,7 +43,7 @@ void DlgSettingsWidget::save()
MetalinkSettings::setMirrorsPerFile(ui.kcfg_MirrorsPerFile->value());
MetalinkSettings::setConnectionsPerUrl(ui.kcfg_ConnectionsPerUrl->value());
MetalinkSettings::self()->writeConfig();
MetalinkSettings::self()->save();
}
#include "dlgmetalink.moc"
......@@ -128,7 +128,7 @@ void DlgSettingsWidget::saveSearchEnginesSettings()
MirrorSearchSettings::self()->setSearchEnginesNameList(enginesNames);
MirrorSearchSettings::self()->setSearchEnginesUrlList(enginesUrls);
MirrorSearchSettings::self()->writeConfig();
MirrorSearchSettings::self()->save();
}
void DlgSettingsWidget::save()
......@@ -136,7 +136,7 @@ void DlgSettingsWidget::save()
kDebug(5001);
saveSearchEnginesSettings();
MirrorSearchSettings::self()->writeConfig();
MirrorSearchSettings::self()->save();
}
#include "dlgmirrorsearch.moc"
......@@ -39,7 +39,7 @@ void DlgMmsSettings::save()
{
qDebug() << "Saving Multithreaded config";
MmsSettings::setThreads(ui.numThreadSpinBox->value());
MmsSettings::self()->writeConfig();
MmsSettings::self()->save();
}
......
......@@ -44,7 +44,7 @@ void DlgSettingsWidget::save()
MultiSegKioSettings::setUseSearchEngines(ui.enginesCheckBox->isChecked());
MultiSegKioSettings::setUseSearchVerification(ui.verificationCheckBox->isChecked());
MultiSegKioSettings::self()->writeConfig();
MultiSegKioSettings::self()->save();
}
#include "dlgmultisegkio.moc"
......@@ -119,7 +119,7 @@ DropTarget::~DropTarget()
{
Settings::setDropPosition( pos() );
Settings::setShowDropTarget( !isHidden() );
Settings::self()->writeConfig();
Settings::self()->save();
// unsigned long state = KWindowSystem::windowInfo(kdrop->winId()).state();
// // state will be 0L if droptarget is hidden. Sigh.
// config->writeEntry("State", state ? state : DEFAULT_DOCK_STATE );
......
......@@ -108,7 +108,7 @@ RangeTreeWidget::~RangeTreeWidget()
list.append(columnWidth(i));
}
Settings::setHistoryColumnWidths(list);
Settings::self()->writeConfig();
Settings::self()->save();
clear();
delete m_rangeDelegate;
......
......@@ -39,6 +39,7 @@
#include <KPushButton>
#include <KIcon>
#include <KLocale>
#include <QFontDatabase>
TransferHistory::TransferHistory(QWidget *parent)
: KGetSaveSizeDialog("TransferHistory", parent),
......@@ -245,7 +246,7 @@ void TransferHistory::slotLoadRangeType(int type)
}
} else {
RangeTreeWidget *range_view = qobject_cast <RangeTreeWidget *> (m_view);
QFontMetrics *font = new QFontMetrics(KGlobalSettings::generalFont());
QFontMetrics *font = new QFontMetrics(QFontDatabase::systemFont(QFontDatabase::GeneralFont));
range_view->clear();
range_view->setLabels(QStringList() << i18n("Source File") << i18n("Destination") << i18n("Time") << i18n("File Size") << i18n("Status"));
......
......@@ -65,7 +65,7 @@ void CountryModel::setupModelData(const QStringList &countryCodes)
{
foreach (const QString &countryCode, countryCodes)
{
const QString countryName = KGlobal::locale()->countryCodeToName(countryCode);
const QString countryName = KLocale::global()->countryCodeToName(countryCode);
if (!countryName.isEmpty())
{
m_countryCodes.append(countryCode);
......@@ -129,7 +129,7 @@ void LanguageModel::setupModelData(const QStringList &languageCodes)
continue;
}
QString languageName = KGlobal::locale()->languageCodeToName(languageCode);
QString languageName = KLocale::global()->languageCodeToName(languageCode);
if (!languageName.isEmpty())
{
m_languageCodes.append(languageCode);
......
......@@ -143,7 +143,7 @@ void MetalinkCreator::slotDelayedCreation()
m_countrySort->sort(0);
m_languageModel = new LanguageModel(this);
//m_languageModel->setupModelData(KGlobal::locale()->allLanguagesList());
//m_languageModel->setupModelData(KLocale::global()->allLanguagesList());
m_languageSort = new QSortFilterProxyModel(this);
m_languageSort->setSourceModel(m_languageModel);
m_languageSort->sort(0);
......
......@@ -355,7 +355,7 @@ bool KGetMetalink::Url::operator<(const KGetMetalink::Url &other) const
bool smaller = (this->priority > other.priority) || ((this->priority == 0) && (other.priority != 0));
if (!smaller && (this->priority == other.priority)) {
QString countryCode;// = KGlobal::locale()->country();//TODO: Port
QString countryCode;// = KLocale::global()->country();//TODO: Port
if (!countryCode.isEmpty()) {
smaller = (other.location.toLower() == countryCode.toLower());
}
......
......@@ -321,7 +321,7 @@ bool MirrorItem::setData(int column, const QVariant &value, int role)
else if ((column == MirrorItem::Country) && (role == Qt::EditRole))
{
m_countryCode = value.toString();
m_countryName = KGlobal::locale()->countryCodeToName(m_countryCode);
m_countryName = KLocale::global()->countryCodeToName(m_countryCode);
if (!m_countryName.isEmpty())
{
......
......@@ -35,6 +35,7 @@
#include <KDebug>
#include <KFileDialog>
#include <KWindowSystem>
#include <QStandardPaths>
Q_GLOBAL_STATIC(NewTransferDialogHandler, newTransferDialogHandler)
......@@ -406,7 +407,7 @@ void NewTransferDialog::dialogAccepted()
dir = m_destination.adjusted(QUrl::RemoveFilename).toString();
}
Settings::setLastDirectory(dir);
Settings::self()->writeConfig();
Settings::self()->save();
const QString group = ui.groupComboBox->currentText();
......@@ -624,7 +625,7 @@ void NewTransferDialogHandler::handleUrls(const int jobId)
const QString groupName = (groups.isEmpty() ? QString() : groups.first()->name());
QString defaultFolder;
if (groups.isEmpty()) {
defaultFolder = (Settings::askForDestination() ? QString() : KGlobalSettings::downloadPath());
defaultFolder = (Settings::askForDestination() ? QString() : QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
} else {
defaultFolder = groups.first()->defaultFolder();
}
......@@ -727,10 +728,10 @@ void NewTransferDialogHandler::handleUrls(const int jobId)
}
}
///Download the rest of the urls to KGlobalSettings::downloadPath() if the user is not aksed for a destination
///Download the rest of the urls to QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) if the user is not aksed for a destination
if (!Settings::askForDestination()) {
//the download path will be always used
const QString dir = KGlobalSettings::downloadPath();
const QString dir = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
if (!dir.isEmpty()) {
QList<QUrl>::iterator it = urls.begin();
while (it != urls.end()) {
......
......@@ -182,7 +182,7 @@ void TransfersView::slotSectionMoved(int logicalIndex, int oldVisualIndex, int n
void TransfersView::slotSaveHeader()
{
Settings::setHeaderState(header()->saveState().toBase64());
Settings::self()->writeConfig();
Settings::self()->save();
}
void TransfersView::dragMoveEvent ( QDragMoveEvent * event )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment