Commit e3565729 authored by David Faure's avatar David Faure
Browse files

Rename enum values as per old TODO

parent 8e0236f5
......@@ -57,8 +57,8 @@ class KONQ_TESTS_EXPORT KonqFrameBase
public:
enum Option {
None = 0x0,
saveURLs = 0x01, // TODO rename to SaveUrls
saveHistoryItems = 0x02 // TODO rename to SaveHistoryItems
SaveUrls = 0x01,
SaveHistoryItems = 0x02
};
Q_DECLARE_FLAGS(Options, Option)
......
......@@ -4688,7 +4688,7 @@ void KonqMainWindow::saveProperties(KConfigGroup &config)
// This can happen via ToggleViewGUIClient -> KServiceTypeTrader::query
// -> KSycoca running kbuildsycoca -> nested event loop.
if (m_fullyConstructed) {
KonqFrameBase::Options flags = KonqFrameBase::saveHistoryItems;
KonqFrameBase::Options flags = KonqFrameBase::SaveHistoryItems;
m_pViewManager->saveViewConfigToGroup(config, flags);
}
}
......@@ -5051,7 +5051,7 @@ void KonqMainWindow::slotAddClosedUrl(KonqFrameBase *tab)
QString prefix = KonqFrameBase::frameTypeToString(tab->frameType()) + QString::number(0);
closedTabItem->configGroup().writeEntry("RootItem", prefix);
prefix.append(QLatin1Char('_'));
KonqFrameBase::Options flags = KonqFrameBase::saveHistoryItems;
KonqFrameBase::Options flags = KonqFrameBase::SaveHistoryItems;
tab->saveConfig(closedTabItem->configGroup(), prefix, flags, nullptr, 0, 1);
m_paClosedItems->setEnabled(true);
......
......@@ -1283,13 +1283,13 @@ bool KonqView::supportsMimeType(const QString &mimeType) const
void HistoryEntry::saveConfig(KConfigGroup &config, const QString &prefix, const KonqFrameBase::Options &options)
{
if (options & KonqFrameBase::saveURLs) {
if (options & KonqFrameBase::SaveUrls) {
config.writeEntry(QStringLiteral("Url").prepend(prefix), url.url());
config.writeEntry(QStringLiteral("LocationBarURL").prepend(prefix), locationBarURL);
config.writeEntry(QStringLiteral("Title").prepend(prefix), title);
config.writeEntry(QStringLiteral("StrServiceType").prepend(prefix), strServiceType);
config.writeEntry(QStringLiteral("StrServiceName").prepend(prefix), strServiceName);
} else if (options & KonqFrameBase::saveHistoryItems) {
} else if (options & KonqFrameBase::SaveHistoryItems) {
config.writeEntry(QStringLiteral("Url").prepend(prefix), url.url());
config.writeEntry(QStringLiteral("LocationBarURL").prepend(prefix), locationBarURL);
config.writeEntry(QStringLiteral("Title").prepend(prefix), title);
......@@ -1306,16 +1306,16 @@ void HistoryEntry::saveConfig(KConfigGroup &config, const QString &prefix, const
void HistoryEntry::loadItem(const KConfigGroup &config, const QString &prefix, const KonqFrameBase::Options &options)
{
if (options & (KonqFrameBase::saveURLs|KonqFrameBase::saveHistoryItems)) { // either one
if (options & (KonqFrameBase::SaveUrls|KonqFrameBase::SaveHistoryItems)) { // either one
url = QUrl(config.readEntry(QStringLiteral("Url").prepend(prefix), ""));
locationBarURL = config.readEntry(QStringLiteral("LocationBarURL").prepend(prefix), "");
title = config.readEntry(QStringLiteral("Title").prepend(prefix), "");
strServiceType = config.readEntry(QStringLiteral("StrServiceType").prepend(prefix), "");
strServiceName = config.readEntry(QStringLiteral("StrServiceName").prepend(prefix), "");
}
if (options & KonqFrameBase::saveURLs) {
if (options & KonqFrameBase::SaveUrls) {
reload = true;
} else if (options & KonqFrameBase::saveHistoryItems) {
} else if (options & KonqFrameBase::SaveHistoryItems) {
buffer = config.readEntry(QStringLiteral("Buffer").prepend(prefix), QByteArray());
postData = config.readEntry(QStringLiteral("PostData").prepend(prefix), QByteArray());
postContentType = config.readEntry(QStringLiteral("PostContentType").prepend(prefix), "");
......@@ -1336,9 +1336,9 @@ void KonqView::saveConfig(KConfigGroup &config, const QString &prefix, const Kon
config.writeEntry(QStringLiteral("ToggleView").prepend(prefix), isToggleView());
config.writeEntry(QStringLiteral("LockedLocation").prepend(prefix), isLockedLocation());
if (options & KonqFrameBase::saveURLs) {
if (options & KonqFrameBase::SaveUrls) {
config.writePathEntry(QStringLiteral("URL").prepend(prefix), url().url());
} else if (options & KonqFrameBase::saveHistoryItems) {
} else if (options & KonqFrameBase::SaveHistoryItems) {
if (m_pPart && !m_bLockHistory) {
updateHistoryEntry(true);
}
......@@ -1348,9 +1348,9 @@ void KonqView::saveConfig(KConfigGroup &config, const QString &prefix, const Kon
// history for current history item
KonqFrameBase::Options options;
if (i == m_lstHistoryIndex) {
options = KonqFrameBase::saveHistoryItems;
options = KonqFrameBase::SaveHistoryItems;
} else {
options = KonqFrameBase::saveURLs;
options = KonqFrameBase::SaveUrls;
}
(*it)->saveConfig(config, QLatin1String("HistoryItem")
......@@ -1383,9 +1383,9 @@ void KonqView::loadHistoryConfig(const KConfigGroup &config, const QString &pref
// Only current history item saves completely its HistoryEntry
KonqFrameBase::Options options;
if (i == currentIndex) {
options = KonqFrameBase::saveHistoryItems;
options = KonqFrameBase::SaveHistoryItems;
} else {
options = KonqFrameBase::saveURLs;
options = KonqFrameBase::SaveUrls;
}
historyEntry->loadItem(config, QLatin1String("HistoryItem") + QString::number(i).prepend(prefix), options);
......
......@@ -297,7 +297,7 @@ void KonqViewManager::duplicateTab(int tabIndex, bool openAfterCurrentPage)
QString prefix = KonqFrameBase::frameTypeToString(tab->frameType()) + QString::number(0); // always T0
profileGroup.writeEntry("RootItem", prefix);
prefix.append(QLatin1Char('_'));
KonqFrameBase::Options flags = KonqFrameBase::saveHistoryItems;
KonqFrameBase::Options flags = KonqFrameBase::SaveHistoryItems;
tab->saveConfig(profileGroup, prefix, flags, nullptr, 0, 1);
loadRootItem(profileGroup, tabContainer(), QUrl(), true, QUrl(), QString(), openAfterCurrentPage);
......@@ -331,7 +331,7 @@ KonqMainWindow *KonqViewManager::breakOffTab(int tab, const QSize &windowSize)
QString prefix = KonqFrameBase::frameTypeToString(tabFrame->frameType()) + QString::number(0); // always T0
profileGroup.writeEntry("RootItem", prefix);
prefix.append(QLatin1Char('_'));
KonqFrameBase::Options flags = KonqFrameBase::saveHistoryItems;
KonqFrameBase::Options flags = KonqFrameBase::SaveHistoryItems;
tabFrame->saveConfig(profileGroup, prefix, flags, nullptr, 0, 1);
KonqMainWindow *mainWindow = new KonqMainWindow;
......@@ -1441,7 +1441,7 @@ KonqMainWindow *KonqViewManager::duplicateWindow()
tempFile.open();
KConfig config(tempFile.fileName());
KConfigGroup group(&config, "Profile");
KonqFrameBase::Options flags = KonqFrameBase::saveHistoryItems;
KonqFrameBase::Options flags = KonqFrameBase::SaveHistoryItems;
saveViewConfigToGroup(group, flags);
KonqMainWindow *mainWindow = openSavedWindow(group);
......
......@@ -187,7 +187,7 @@ public:
/**
* Saves the current view layout to a group in a config file.
* This is shared between saveViewProfileToFile and saveProperties (session management)
* Remove config file before saving, especially if saveURLs is false.
* Remove config file before saving, especially if SaveUrls is false.
* @param cfg the config file
* @param options whether to save nothing, the URLs or the complete history of each view in the profile
*/
......
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