Commit 4a256e9b authored by David Faure's avatar David Faure

Fix deprecation warnings, and a TODO now that we're not using a protected method anymore

parent b90b0b03
......@@ -2643,7 +2643,7 @@ void KonqMainWindow::slotCopyFiles()
KIO::CopyJob *job = KIO::copy(currentURLs(), dest);
KIO::FileUndoManager::self()->recordCopyJob(job);
KJobWidgets::setWindow(job, this);
job->ui()->setAutoErrorHandlingEnabled(true);
job->uiDelegate()->setAutoErrorHandlingEnabled(true);
}
void KonqMainWindow::slotMoveFiles()
......@@ -2656,7 +2656,7 @@ void KonqMainWindow::slotMoveFiles()
KIO::CopyJob *job = KIO::move(currentURLs(), dest);
KIO::FileUndoManager::self()->recordCopyJob(job);
KJobWidgets::setWindow(job, this);
job->ui()->setAutoErrorHandlingEnabled(true);
job->uiDelegate()->setAutoErrorHandlingEnabled(true);
}
QList<QUrl> KonqMainWindow::currentURLs() const
......@@ -4922,6 +4922,8 @@ void KonqMainWindow::closeEvent(QCloseEvent *e)
case KMessageBox::Cancel :
e->ignore();
return;
default:
Q_UNREACHABLE();
}
}
}
......@@ -5511,16 +5513,6 @@ bool KonqMainWindow::accept(KonqFrameVisitor *visitor)
&& visitor->endVisit(this);
}
void KonqMainWindow::applyWindowSizeFromProfile(const KConfigGroup &profileGroup)
{
// KMainWindow::restoreWindowSize is protected so this logic can't move to KonqViewManager
const QSize size = KonqViewManager::readDefaultSize(profileGroup, this); // example: "Width=80%"
if (size.isValid()) {
resize(size);
}
restoreWindowSize(profileGroup); // example: "Width 1400=1120"
}
QLineEdit *KonqMainWindow::comboEdit()
{
return m_combo ? m_combo->lineEdit() : 0;
......
......@@ -305,7 +305,6 @@ public:
// Not used by konqueror itself; only exists for the Q_PROPERTY,
// which I guess is used by scripts and plugins...
QString currentURL() const;
void applyWindowSizeFromProfile(const KConfigGroup &profileGroup);
void updateHistoryActions();
......
......@@ -49,6 +49,7 @@
#include <QDesktopWidget>
#include <QStandardPaths>
#include <KSharedConfig>
#include <KWindowConfig>
//#define DEBUG_VIEWMGR
......@@ -958,7 +959,7 @@ void KonqViewManager::loadViewConfigFromGroup(const KConfigGroup &profileGroup,
} else {
// Full screen off
m_pMainWindow->setWindowState(m_pMainWindow->windowState() & ~Qt::WindowFullScreen);
m_pMainWindow->applyWindowSizeFromProfile(profileGroup);
applyWindowSize(profileGroup);
}
}
......@@ -1034,7 +1035,8 @@ void KonqViewManager::emitActivePartChanged()
m_pMainWindow->slotPartActivated(activePart());
}
QSize KonqViewManager::readDefaultSize(const KConfigGroup &cfg, QWidget *widget)
// Read default size from profile (e.g. Width=80%)
static QSize readDefaultSize(const KConfigGroup &cfg, QWidget *widget)
{
QString widthStr = cfg.readEntry("Width");
QString heightStr = cfg.readEntry("Height");
......@@ -1072,6 +1074,15 @@ QSize KonqViewManager::readDefaultSize(const KConfigGroup &cfg, QWidget *widget)
return QSize(width, height);
}
void KonqViewManager::applyWindowSize(const KConfigGroup &profileGroup)
{
const QSize size = readDefaultSize(profileGroup, m_pMainWindow); // example: "Width=80%"
if (size.isValid()) {
m_pMainWindow->resize(size);
}
KWindowConfig::restoreWindowSize(m_pMainWindow->windowHandle(), profileGroup); // example: "Width 1400=1120"
}
void KonqViewManager::loadRootItem(const KConfigGroup &cfg, KonqFrameContainerBase *parent,
const QUrl &defaultURL, bool openUrl,
const QUrl &forcedUrl, const QString &forcedService,
......
......@@ -243,10 +243,7 @@ public:
void doSetActivePart(KParts::ReadOnlyPart *part);
/**
* Read default size from profile (e.g. Width=80%)
*/
static QSize readDefaultSize(const KConfigGroup &cfg, QWidget *window);
void applyWindowSize(const KConfigGroup &profileGroup);
#ifndef NDEBUG
void printFullHierarchy();
......
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