Commit 51d19b4d authored by Laurent Montel's avatar Laurent Montel 😁

kdelibs4support--

parent 4d57f1d0
......@@ -334,7 +334,7 @@ bool KCookiesManagement::cookieDetails(CookieProp *cookie)
{
KDateTime expDate;
expDate.setTime_t(tmp);
cookie->expireDate = KGlobal::locale()->formatDateTime(expDate);
cookie->expireDate = KLocale::global()->formatDateTime(expDate);
}
tmp = (*c).toUInt(&ok);
......
......@@ -70,7 +70,7 @@ SMBRoOptions::SMBRoOptions(QWidget *parent, const QVariantList &, const KCompone
layout->addWidget(m_showHiddenShares,4,0, 1, 2 );
m_encodingList = new KComboBox( false, this );
QStringList _strList = KGlobal::charsets()->availableEncodingNames();
QStringList _strList = KCharsets::charsets()->availableEncodingNames();
m_encodingList->addItems( _strList );
label = new QLabel( i18n( "MS Windows encoding:" ), this );
......@@ -105,7 +105,7 @@ void SMBRoOptions::load()
// m_workgroupLe->setText(group.readEntry("Workgroup"));
// m_showHiddenShares->setChecked(group.readEntry("ShowHiddenShares", QVariant(false)).toBool());
//QStringList _strList = KGlobal::charsets()->availableEncodingNames();
//QStringList _strList = KCharsets::charsets()->availableEncodingNames();
//QString m_encoding = QTextCodec::codecForLocale()->name();
//m_encodingList->setCurrentIndex( _strList.indexOf( group.readEntry( "Encoding", m_encoding.toLower() ) ) );
......
......@@ -97,7 +97,7 @@ void UserAgentInfo::parseDescription()
tmp.replace( QFL("appSysRelease"), QString(utsn.release) );
tmp.replace( QFL("appMachineType"), QString(utsn.machine) );
QStringList languageList = KGlobal::locale()->languageList();
QStringList languageList = KLocale::global()->languageList();
if ( languageList.count() )
{
int ind = languageList.indexOf( QLatin1String("C") );
......
......@@ -25,6 +25,7 @@
#if defined Q_WS_X11 && !defined K_WS_QTONLY
#include <X11/Xlib.h>
#include <QFontDatabase>
#endif
#include "appearance.moc"
......@@ -236,7 +237,7 @@ KAppearanceOptions::KAppearanceOptions(QWidget *parent, const QVariantList&)
m_pEncoding = new QComboBox( this );
m_pEncoding->setEditable( false );
encodings = KGlobal::charsets()->availableEncodingNames();
encodings = KCharsets::charsets()->availableEncodingNames();
encodings.prepend(i18n("Use Language Encoding"));
m_pEncoding->addItems( encodings );
fl->addRow(i18n( "Default encoding:"), m_pEncoding);
......@@ -349,8 +350,8 @@ void KAppearanceOptions::load()
fSize = fMinSize;
defaultFonts = QStringList();
defaultFonts.append( READ_ENTRY( "StandardFont", KGlobalSettings::generalFont().family() ) );
defaultFonts.append( READ_ENTRY( "FixedFont", KGlobalSettings::fixedFont().family() ) );
defaultFonts.append( READ_ENTRY( "StandardFont", QFontDatabase::systemFont(QFontDatabase::GeneralFont).family() ) );
defaultFonts.append( READ_ENTRY( "FixedFont", QFontDatabase::systemFont(QFontDatabase::FixedFont).family() ) );
defaultFonts.append( READ_ENTRY( "SerifFont", HTML_DEFAULT_VIEW_SERIF_FONT ) );
defaultFonts.append( READ_ENTRY( "SansSerifFont", HTML_DEFAULT_VIEW_SANSSERIF_FONT ) );
defaultFonts.append( READ_ENTRY( "CursiveFont", HTML_DEFAULT_VIEW_CURSIVE_FONT ) );
......
......@@ -51,7 +51,7 @@ void KHTTPOptions::load()
{
QString tmp;
KConfigGroup cg(m_pConfig, "Browser Settings/HTTP");
tmp = cg.readEntry( "AcceptLanguages",KGlobal::locale()->languageList().join(","));
tmp = cg.readEntry( "AcceptLanguages",KLocale::global()->languageList().join(","));
le_languages->setText( tmp );
tmp = cg.readEntry( "AcceptCharsets",defaultCharsets);
le_charsets->setText( tmp );
......@@ -67,7 +67,7 @@ void KHTTPOptions::save()
void KHTTPOptions::defaults()
{
le_languages->setText( KGlobal::locale()->languageList().join(",") );
le_languages->setText( KLocale::global()->languageList().join(",") );
le_charsets->setText( defaultCharsets );
}
......
......@@ -56,7 +56,8 @@ K_EXPORT_PLUGIN(KCMHistoryFactory("kcmhistory"))
HistorySidebarConfig::HistorySidebarConfig( QWidget *parent, const QVariantList & )
: KCModule (KCMHistoryFactory::componentData(), parent, QVariantList())
{
KGlobal::locale()->insertCatalog("konqueror");
//KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
//KLocale::global()->insertCatalog("konqueror");
m_settings = KonqHistorySettings::self();
......
......@@ -42,7 +42,7 @@ KonquerorApplication::KonquerorApplication()
void KonquerorApplication::slotReparseConfiguration()
{
KGlobal::config()->reparseConfiguration();
KSharedConfig::openConfig()->reparseConfiguration();
KonqFMSettings::reparseConfiguration();
QList<KonqMainWindow*> *mainWindows = KonqMainWindow::mainWindowList();
......
......@@ -34,6 +34,7 @@
#include <kcolorscheme.h>
#include <kstandarddirs.h>
#include <unistd.h>
#include <QFontDatabase>
class KonqIcon {
public:
......@@ -91,7 +92,7 @@ QPixmap KonqClosedWindowItem::icon() const
int oldWidth = overlayImg.width();
QString countStr = QString::number( m_numTabs );
QFont f = KGlobalSettings::generalFont();
QFont f = QFontDatabase::systemFont(QFontDatabase::GeneralFont);
f.setBold(true);
float pointSize = f.pointSizeF();
......
......@@ -61,7 +61,7 @@ KonqClosedWindowsManager::KonqClosedWindowsManager()
QString file = KStandardDirs::locateLocal("tmp", filename);
QFile::remove(file);
KConfigGroup configGroup(KGlobal::config(), "Undo");
KConfigGroup configGroup(KSharedConfig::openConfig(), "Undo");
m_numUndoClosedItems = configGroup.readEntry("Number of Closed Windows", 0);
m_konqClosedItemsConfig = 0L;
......@@ -367,7 +367,7 @@ void KonqClosedWindowsManager::saveConfig()
closedWindowItem->configGroup().copyTo(&configGroup);
}
KConfigGroup configGroup(KGlobal::config(), "Undo");
KConfigGroup configGroup(KSharedConfig::openConfig(), "Undo");
configGroup.writeEntry("Number of Closed Windows", m_closedWindowItemList.size());
configGroup.sync();
......@@ -404,7 +404,7 @@ void KonqClosedWindowsManager ::readConfig()
if(!configGroup.exists())
{
m_numUndoClosedItems = i;
KConfigGroup configGroup(KGlobal::config(), "Undo");
KConfigGroup configGroup(KSharedConfig::openConfig(), "Undo");
configGroup.writeEntry("Number of Closed Windows",
m_closedWindowItemList.size());
configGroup.sync();
......
......@@ -45,6 +45,7 @@
#include <konqmainwindow.h>
#include <kstringhandler.h>
#include <kshortcut.h>
#include <QApplication>
// Local
#include "konqview.h"
......@@ -594,7 +595,7 @@ void KonqCombo::mouseMoveEvent( QMouseEvent *e )
if ( e->buttons() & Qt::LeftButton &&
(e->pos() - m_dragStart).manhattanLength() >
KGlobalSettings::dndEventDelay() )
QApplication::startDragDistance() )
{
KUrl url( currentText() );
if ( url.isValid() )
......
......@@ -71,7 +71,7 @@ KonqExtensionManager::KonqExtensionManager(QWidget *parent, KonqMainWindow *main
d->mainWindow = mainWindow;
d->activePart = activePart;
d->pluginSelector->addPlugins("konqueror", i18n("Extensions"), "Extensions", KGlobal::config());
d->pluginSelector->addPlugins("konqueror", i18n("Extensions"), "Extensions", KSharedConfig::openConfig());
if ( activePart ) {
KAboutData componentData = activePart->componentData();
d->pluginSelector->addPlugins(componentData.componentName(), i18n("Extensions"), "Tools");
......
......@@ -75,7 +75,7 @@ KonqHistoryDialog::KonqHistoryDialog(KonqMainWindow *parent)
mainLayout->addWidget(toolBar);
mainLayout->addWidget(m_historyView);
restoreDialogSize(KGlobal::config()->group("History Dialog"));
restoreDialogSize(KSharedConfig::openConfig()->group("History Dialog"));
// give focus to the search line edit when opening the dialog (#240513)
m_historyView->lineEdit()->setFocus();
......@@ -83,7 +83,7 @@ KonqHistoryDialog::KonqHistoryDialog(KonqMainWindow *parent)
KonqHistoryDialog::~KonqHistoryDialog()
{
KConfigGroup group(KGlobal::config(), "History Dialog");
KConfigGroup group(KSharedConfig::openConfig(), "History Dialog");
saveDialogSize(group);
}
......
......@@ -136,9 +136,9 @@ QVariant HistoryEntry::data(int role, int /*column*/) const
case KonqHistory::DetailedToolTipRole:
return i18n("<qt><center><b>%1</b></center><hr />Last visited: %2<br />"
"First visited: %3<br />Number of times visited: %4</qt>",
Qt::escape(entry.url.pathOrUrl()),
KGlobal::locale()->formatDateTime(entry.lastVisited),
KGlobal::locale()->formatDateTime(entry.firstVisited),
entry.url.pathOrUrl().toHtmlEscaped(),
KLocale::global()->formatDateTime(entry.lastVisited),
KLocale::global()->formatDateTime(entry.firstVisited),
entry.numberOfTimesVisited);
case KonqHistory::LastVisitedRole:
return entry.lastVisited;
......
......@@ -62,7 +62,7 @@ void KonqHistorySettings::readSettings(bool reparse)
KSharedConfigPtr config;
if (KGlobal::mainComponent().componentName() == QLatin1String("konqueror"))
config = KGlobal::config();
config = KSharedConfig::openConfig();
else
config = KSharedConfig::openConfig("konquerorrc");
......
......@@ -161,6 +161,7 @@
#include <kshortcut.h>
#include <kglobalsettings.h>
#include <kurlauthorized.h>
#include <QFontDatabase>
template class QList<QPixmap*>;
template class QList<KToggleAction*>;
......@@ -295,7 +296,7 @@ KonqMainWindow::KonqMainWindow( const KUrl &initialURL, const QString& xmluiFile
createGUI( 0 );
m_combo->setParent( toolBar("locationToolBar") );
m_combo->setFont( KGlobalSettings::generalFont() );
m_combo->setFont( QFontDatabase::systemFont(QFontDatabase::GeneralFont) );
m_combo->show();
checkDisableClearButton();
......@@ -1346,7 +1347,7 @@ void KonqMainWindow::slotCreateNewWindow( const KUrl &url,
// Make the window open properties configurable. This is equivalent to
// Firefox's "dom.disable_window_open_feature.*" properties. For now
// only LocationBar visiblity is configurable.
KSharedConfig::Ptr config = KGlobal::config();
KSharedConfig::Ptr config = KSharedConfig::openConfig();
KConfigGroup cfg (config, "DisableWindowOpenFeatures");
if ( !windowArgs.isMenuBarVisible() )
......@@ -1574,7 +1575,7 @@ void KonqMainWindow::slotOpenFile()
if (m_currentView && m_currentView->url().isLocalFile())
currentUrl = m_currentView->url();
else
currentUrl = KUrl::fromPath(QDir::homePath());
currentUrl = QUrl::fromLocalFile(QDir::homePath());
KUrl url = KFileDialog::getOpenUrl(currentUrl, QString(), this);
if (!url.isEmpty())
......@@ -1652,7 +1653,7 @@ void KonqMainWindow::showHTML( KonqView * _view, bool b, bool _activateView )
// Save this setting
// This has to be done before calling openView since it relies on it
KonqSettings::setHtmlAllowed( b );
KonqSettings::self()->writeConfig();
KonqSettings::self()->save();
if ( _activateView )
m_bHTMLAllowed = b;
......@@ -1913,7 +1914,7 @@ void KonqMainWindow::slotConfigureSpellChecking()
{
#pragma message("TODO KF5: Port Sonnet::ConfigDialog usage somehow")
#if 0 // KF5 TODO
Sonnet::ConfigDialog dialog( KGlobal::config().data(), this);
Sonnet::ConfigDialog dialog( KSharedConfig::openConfig().data(), this);
dialog.setWindowIcon( KIcon( "konqueror" ));
dialog.exec();
#endif
......@@ -1938,7 +1939,7 @@ void KonqMainWindow::slotNewToolbarConfig() // This is called when OK or Apply i
plugViewModeActions();
KConfigGroup cg = KGlobal::config()->group( "KonqMainWindow" );
KConfigGroup cg = KSharedConfig::openConfig()->group( "KonqMainWindow" );
applyMainWindowSettings( cg );
}
......@@ -3110,7 +3111,7 @@ void KonqMainWindow::slotCompletionModeChanged( KCompletion::CompletionMode m )
s_pCompletion->setCompletionMode( m );
KonqSettings::setSettingsCompletionMode( int(m_combo->completionMode()) );
KonqSettings::self()->writeConfig();
KonqSettings::self()->save();
// tell the other windows too (only this instance currently)
foreach ( KonqMainWindow* window, *s_lstViews ) {
......@@ -4896,14 +4897,14 @@ void KonqMainWindow::reparseConfiguration()
{
kDebug();
KonqSettings::self()->readConfig();
KonqSettings::self()->load();
m_pViewManager->applyConfiguration();
KonqRmbEventFilter::self()->reparseConfiguration();
m_bHTMLAllowed = KonqSettings::htmlAllowed();
if (m_combo)
m_combo->setFont( KGlobalSettings::generalFont() );
m_combo->setFont( QFontDatabase::systemFont(QFontDatabase::GeneralFont) );
MapViews::ConstIterator it = m_mapViews.constBegin();
MapViews::ConstIterator end = m_mapViews.constEnd();
......@@ -5132,7 +5133,7 @@ void KonqMainWindow::closeEvent( QCloseEvent *e )
KonqFrameTabs* tabContainer = m_pViewManager->tabContainer();
if ( tabContainer->count() > 1 )
{
KSharedConfig::Ptr config = KGlobal::config();
KSharedConfig::Ptr config = KSharedConfig::openConfig();
KConfigGroup cs( config, QLatin1String("Notification Messages") );
if ( !cs.hasKey( "MultipleTabConfirm" ) )
......
......@@ -55,6 +55,8 @@
#include <QTreeWidget>
#include <QScrollArea>
#include <QScrollBar>
#include <QApplication>
#include <QDesktopWidget>
class KonqSessionManagerPrivate
......@@ -149,7 +151,7 @@ SessionRestoreDialog::SessionRestoreDialog(const QStringList& sessionFilePaths,
styleOption.initFrom(treeWidget);
QFontMetrics fm(styleOption.font);
int w = treeWidget->width();
const QRect desktop = KGlobalSettings::desktopGeometry(this);
const QRect desktop = QApplication::desktop()->screenGeometry(this);
// Collect info from the sessions to restore
Q_FOREACH(const QString& sessionFile, sessionFilePaths) {
......@@ -326,7 +328,7 @@ void SessionRestoreDialog::saveDontShow(const QString& dontShowAgainName, int re
flags |= KConfigGroup::Global;
}
KConfigGroup cg(KGlobal::config().data(), "Notification Messages");
KConfigGroup cg(KSharedConfig::openConfig().data(), "Notification Messages");
cg.writeEntry( dontShowAgainName, result==Yes, flags );
cg.sync();
}
......@@ -337,7 +339,7 @@ bool SessionRestoreDialog::shouldBeShown(const QString& dontShowAgainName, int*
return true;
}
KConfigGroup cg(KGlobal::config().data(), "Notification Messages");
KConfigGroup cg(KSharedConfig::openConfig().data(), "Notification Messages");
const QString dontAsk = cg.readEntry(dontShowAgainName, QString()).toLower();
if (dontAsk == "yes" || dontAsk == "true") {
......
......@@ -46,7 +46,7 @@ public:
/**
* Reparse the configuration to update the already-created instances
*
* Warning : you need to call KGlobal::config()->reparseConfiguration()
* Warning : you need to call KSharedConfig::openConfig()->reparseConfiguration()
* first (This is not done here so that the caller can avoid too much
* reparsing if having several classes from the same config file)
*/
......
......@@ -65,6 +65,7 @@
#include <KParts/OpenUrlArguments>
#include <KParts/BrowserExtension>
#include <KParts/WindowArgs>
#include <KComponentData>
//#define DEBUG_HISTORY
......@@ -1229,9 +1230,9 @@ void KonqView::setActiveComponent()
#if 0 // Removed with the port to KF5. The concept no longer exists, the about dialog and bug report
// dialog just use the application information rather than the one of the current part.
if (m_bBuiltinView)
KGlobal::setActiveComponent( KGlobal::mainComponent() );
KComponentData::setActiveComponent( KGlobal::mainComponent() );
else
KGlobal::setActiveComponent(KComponentData(m_pPart->componentData()));
KComponentData::setActiveComponent(KComponentData(m_pPart->componentData()));
#endif
#ifdef KActivities_FOUND
......
......@@ -50,6 +50,8 @@
#include <ktoolbarpopupaction.h>
#include <kmenu.h>
#include <kdeversion.h>
#include <QApplication>
#include <QDesktopWidget>
//#define DEBUG_VIEWMGR
......@@ -1112,7 +1114,7 @@ QSize KonqViewManager::readDefaultSize(const KConfigGroup &cfg, QWidget *widget)
QString heightStr = cfg.readEntry("Height");
int width = -1;
int height = -1;
const QRect geom = KGlobalSettings::desktopGeometry(widget);
const QRect geom = QApplication::desktop()->screenGeometry(widget);
bool ok;
if (widthStr.endsWith('%')) {
......
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