Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Network
Konqueror
Commits
e62b3d9a
Commit
e62b3d9a
authored
Sep 17, 2016
by
David Faure
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove profile support in konqueror, many cleanups.
parent
77aff9d3
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
155 additions
and
1100 deletions
+155
-1100
konqueror/about/konq_aboutpage.cpp
konqueror/about/konq_aboutpage.cpp
+1
-1
konqueror/src/CMakeLists.txt
konqueror/src/CMakeLists.txt
+1
-2
konqueror/src/KonquerorAdaptor.cpp
konqueror/src/KonquerorAdaptor.cpp
+1
-51
konqueror/src/KonquerorAdaptor.h
konqueror/src/KonquerorAdaptor.h
+2
-48
konqueror/src/konqapplication.cpp
konqueror/src/konqapplication.cpp
+0
-13
konqueror/src/konqapplication.h
konqueror/src/konqapplication.h
+0
-1
konqueror/src/konqcloseditem.cpp
konqueror/src/konqcloseditem.cpp
+1
-1
konqueror/src/konqcombo.cpp
konqueror/src/konqcombo.cpp
+1
-1
konqueror/src/konqmain.cpp
konqueror/src/konqmain.cpp
+3
-26
konqueror/src/konqmainwindow.cpp
konqueror/src/konqmainwindow.cpp
+9
-55
konqueror/src/konqmainwindow.h
konqueror/src/konqmainwindow.h
+0
-11
konqueror/src/konqmainwindowfactory.cpp
konqueror/src/konqmainwindowfactory.cpp
+63
-0
konqueror/src/konqmainwindowfactory.h
konqueror/src/konqmainwindowfactory.h
+39
-0
konqueror/src/konqmisc.cpp
konqueror/src/konqmisc.cpp
+14
-104
konqueror/src/konqmisc.h
konqueror/src/konqmisc.h
+5
-34
konqueror/src/konqprofiledlg.cpp
konqueror/src/konqprofiledlg.cpp
+0
-285
konqueror/src/konqprofiledlg.h
konqueror/src/konqprofiledlg.h
+0
-62
konqueror/src/konqprofiledlg_base.ui
konqueror/src/konqprofiledlg_base.ui
+0
-52
konqueror/src/konqviewmanager.cpp
konqueror/src/konqviewmanager.cpp
+5
-173
konqueror/src/konqviewmanager.h
konqueror/src/konqviewmanager.h
+1
-67
konqueror/src/org.kde.Konqueror.Main.xml
konqueror/src/org.kde.Konqueror.Main.xml
+0
-23
konqueror/src/tests/konqhtmltest.cpp
konqueror/src/tests/konqhtmltest.cpp
+6
-9
konqueror/src/tests/konqviewmgrtest.cpp
konqueror/src/tests/konqviewmgrtest.cpp
+3
-78
konqueror/src/tests/konqviewmgrtest.h
konqueror/src/tests/konqviewmgrtest.h
+0
-3
No files found.
konqueror/about/konq_aboutpage.cpp
View file @
e62b3d9a
...
...
@@ -465,7 +465,7 @@ bool KonqAboutPage::urlSelected(const QString &url, int button, int state, const
else
if
(
url
==
QLatin1String
(
"config:/disable_overview"
))
{
if
(
KMessageBox
::
questionYesNo
(
widget
(),
i18n
(
"Do you want to disable showing "
"the introduction
in the webbrowsing profile
?"
),
"the introduction
page on startup
?"
),
i18nc
(
"@title:window"
,
"Faster Startup?"
),
KGuiItem
(
i18n
(
"Disable"
)),
KGuiItem
(
i18n
(
"Keep"
)))
==
KMessageBox
::
Yes
)
{
QString
profile
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericDataLocation
)
+
QLatin1Char
(
'/'
)
+
"konqueror/profiles/webbrowsing"
;
...
...
konqueror/src/CMakeLists.txt
View file @
e62b3d9a
...
...
@@ -74,7 +74,6 @@ set(konqueror_KDEINIT_SRCS
konqframecontainer.cpp
konqtabs.cpp
konqactions.cpp
konqprofiledlg.cpp
konqsessiondlg.cpp
konqfactory.cpp
konqcombo.cpp
...
...
@@ -82,6 +81,7 @@ set(konqueror_KDEINIT_SRCS
delayedinitializer.cpp
konqanimatedlogo.cpp
konqmainwindow.cpp
konqmainwindowfactory.cpp
konqextensionmanager.cpp
konqbookmarkbar.cpp
konqsettings.cpp
...
...
@@ -97,7 +97,6 @@ set(konqueror_KDEINIT_SRCS
)
kconfig_add_kcfg_files
(
konqueror_KDEINIT_SRCS konqsettingsxt.kcfgc
)
ki18n_wrap_ui
(
konqueror_KDEINIT_SRCS konqprofiledlg_base.ui
)
ki18n_wrap_ui
(
konqueror_KDEINIT_SRCS konqsessiondlg_base.ui
)
ki18n_wrap_ui
(
konqueror_KDEINIT_SRCS konqnewsessiondlg_base.ui
)
...
...
konqueror/src/KonquerorAdaptor.cpp
View file @
e62b3d9a
...
...
@@ -68,7 +68,7 @@ static void setStartupId(const QByteArray &startup_id)
QDBusObjectPath
KonquerorAdaptor
::
openBrowserWindow
(
const
QString
&
url
,
const
QByteArray
&
startup_id
)
{
setStartupId
(
startup_id
);
KonqMainWindow
*
res
=
KonqMisc
::
create
Simple
Window
(
QUrl
::
fromUserInput
(
url
)
,
KParts
::
OpenUrlArguments
()
);
KonqMainWindow
*
res
=
KonqMisc
::
create
New
Window
(
QUrl
::
fromUserInput
(
url
));
if
(
!
res
)
{
return
QDBusObjectPath
(
"/"
);
}
...
...
@@ -106,56 +106,6 @@ QDBusObjectPath KonquerorAdaptor::createNewWindowWithSelection(const QString &ur
return
QDBusObjectPath
(
res
->
dbusName
());
}
QDBusObjectPath
KonquerorAdaptor
::
createBrowserWindowFromProfile
(
const
QString
&
path
,
const
QString
&
filename
,
const
QByteArray
&
startup_id
)
{
setStartupId
(
startup_id
);
qDebug
()
<<
path
<<
","
<<
filename
;
KonqMainWindow
*
res
=
KonqMisc
::
createBrowserWindowFromProfile
(
path
,
filename
);
if
(
!
res
)
{
return
QDBusObjectPath
(
"/"
);
}
res
->
show
();
return
QDBusObjectPath
(
res
->
dbusName
());
}
QDBusObjectPath
KonquerorAdaptor
::
createBrowserWindowFromProfileAndUrl
(
const
QString
&
path
,
const
QString
&
filename
,
const
QString
&
url
,
const
QByteArray
&
startup_id
)
{
setStartupId
(
startup_id
);
KonqMainWindow
*
res
=
KonqMisc
::
createBrowserWindowFromProfile
(
path
,
filename
,
QUrl
::
fromUserInput
(
url
));
if
(
!
res
)
{
return
QDBusObjectPath
(
"/"
);
}
res
->
show
();
return
QDBusObjectPath
(
res
->
dbusName
());
}
QDBusObjectPath
KonquerorAdaptor
::
createBrowserWindowFromProfileUrlAndMimeType
(
const
QString
&
path
,
const
QString
&
filename
,
const
QString
&
url
,
const
QString
&
mimetype
,
const
QByteArray
&
startup_id
)
{
setStartupId
(
startup_id
);
KParts
::
OpenUrlArguments
args
;
args
.
setMimeType
(
mimetype
);
KonqOpenURLRequest
req
;
req
.
args
=
args
;
KonqMainWindow
*
res
=
KonqMisc
::
createBrowserWindowFromProfile
(
path
,
filename
,
QUrl
::
fromUserInput
(
url
),
req
);
if
(
!
res
)
{
return
QDBusObjectPath
(
"/"
);
}
res
->
show
();
return
QDBusObjectPath
(
res
->
dbusName
());
}
void
KonquerorAdaptor
::
updateProfileList
()
{
QList
<
KonqMainWindow
*>
*
mainWindows
=
KonqMainWindow
::
mainWindowList
();
if
(
!
mainWindows
)
{
return
;
}
foreach
(
KonqMainWindow
*
window
,
*
mainWindows
)
{
window
->
viewManager
()
->
profileListDirty
(
false
);
}
}
QList
<
QDBusObjectPath
>
KonquerorAdaptor
::
getWindows
()
{
QList
<
QDBusObjectPath
>
lst
;
...
...
konqueror/src/KonquerorAdaptor.h
View file @
e62b3d9a
...
...
@@ -18,8 +18,8 @@
Boston, MA 02110-1301, USA.
*/
#ifndef
__KonquerorAdaptor_h__
#define
__KonquerorAdaptor_h__
#ifndef
KONQUERORADAPTOR_H
#define
KONQUERORADAPTOR_H
#include <QtCore/QStringList>
#include <QtDBus/QtDBus>
...
...
@@ -67,43 +67,6 @@ public slots:
*/
QDBusObjectPath
createNewWindowWithSelection
(
const
QString
&
url
,
const
QStringList
&
filesToSelect
,
const
QByteArray
&
startup_id
);
/**
* As the name says, this creates a window from a profile.
* Used for instance by kfmclient.
* @param path full path to the profile file
* @param filename name of the profile file, if under the profiles dir (can be empty if not known, e.g. from khelpcenter)
* @param startup_id sets the application startup notification (ASN) property on the window, if not empty.
* @return the DBUS object path of the window
*/
QDBusObjectPath
createBrowserWindowFromProfile
(
const
QString
&
path
,
const
QString
&
filename
,
const
QByteArray
&
startup_id
);
/**
* Creates a window from a profile and a URL.
* Used by kfmclient to open http URLs with the webbrowsing profile
* and others with the filemanagement profile.
* @param path full path to the profile file
* @param filename name of the profile file, if under the profiles dir
* @param url the URL to open
* @param startup_id sets the application startup notification (ASN) property on the window, if not empty.
* @return the DBUS object path of the window
*/
QDBusObjectPath
createBrowserWindowFromProfileAndUrl
(
const
QString
&
path
,
const
QString
&
filename
,
const
QString
&
url
,
const
QByteArray
&
startup_id
);
/**
* Creates a window the fastest way : the caller has to provide
* profile, URL, and mimetype.
* @param path full path to the profile file
* @param filename name of the profile file, if under the profiles dir
* @param url the URL to open
* @param mimetype the mimetype that the URL we want to open has
* @param startup_id sets the application startup notification (ASN) property on the window, if not empty.
* @return the DBUS object path of the window
*/
QDBusObjectPath
createBrowserWindowFromProfileUrlAndMimeType
(
const
QString
&
path
,
const
QString
&
filename
,
const
QString
&
url
,
const
QString
&
mimetype
,
const
QByteArray
&
startup_id
);
/**
* @return a list of references to all the windows
*/
...
...
@@ -114,11 +77,6 @@ public slots:
*/
QDBusObjectPath
windowForTab
();
/**
* Called internally as broadcast when the user adds/removes/renames a view profile
*/
Q_NOREPLY
void
updateProfileList
();
/**
* Called from konqy_preloader to terminate this Konqueror instance,
* if it's in the preloaded mode, and there are too many preloaded Konqy's
...
...
@@ -130,10 +88,6 @@ Q_SIGNALS:
* Emitted by kcontrol when the global configuration changes
*/
void
reparseConfiguration
();
/**
* Emitted by konqueror when we must update list of profiles
*/
void
updateAllProfileList
();
/**
* Used internally by Konqueror to notify all instances when a URL should be added to the combobox.
*/
...
...
konqueror/src/konqapplication.cpp
View file @
e62b3d9a
...
...
@@ -36,7 +36,6 @@ KonquerorApplication::KonquerorApplication()
const
QString
dbusInterface
=
"org.kde.Konqueror.Main"
;
QDBusConnection
dbus
=
QDBusConnection
::
sessionBus
();
dbus
.
connect
(
QString
(),
KONQ_MAIN_PATH
,
dbusInterface
,
"reparseConfiguration"
,
this
,
SLOT
(
slotReparseConfiguration
()));
dbus
.
connect
(
QString
(),
KONQ_MAIN_PATH
,
dbusInterface
,
"updateAllProfileList"
,
this
,
SLOT
(
slotUpdateProfileList
()));
dbus
.
connect
(
QString
(),
KONQ_MAIN_PATH
,
dbusInterface
,
"addToCombo"
,
this
,
SLOT
(
slotAddToCombo
(
QString
,
QDBusMessage
)));
dbus
.
connect
(
QString
(),
KONQ_MAIN_PATH
,
dbusInterface
,
"removeFromCombo"
,
this
,
...
...
@@ -57,18 +56,6 @@ void KonquerorApplication::slotReparseConfiguration()
}
}
void
KonquerorApplication
::
slotUpdateProfileList
()
{
QList
<
KonqMainWindow
*>
*
mainWindows
=
KonqMainWindow
::
mainWindowList
();
if
(
!
mainWindows
)
{
return
;
}
foreach
(
KonqMainWindow
*
window
,
*
mainWindows
)
{
window
->
viewManager
()
->
profileListDirty
(
false
);
}
}
void
KonquerorApplication
::
slotAddToCombo
(
const
QString
&
url
,
const
QDBusMessage
&
msg
)
{
KonqMainWindow
::
comboAction
(
KonqMainWindow
::
ComboAdd
,
url
,
msg
.
service
());
...
...
konqueror/src/konqapplication.h
View file @
e62b3d9a
...
...
@@ -33,7 +33,6 @@ public:
public
slots
:
void
slotReparseConfiguration
();
void
slotUpdateProfileList
();
private
slots
:
void
slotAddToCombo
(
const
QString
&
url
,
const
QDBusMessage
&
msg
);
...
...
konqueror/src/konqcloseditem.cpp
View file @
e62b3d9a
...
...
@@ -56,7 +56,7 @@ KonqClosedItem::KonqClosedItem(const QString &title, const QString &group, quint
KonqClosedItem
::~
KonqClosedItem
()
{
qDebug
()
<<
"deleting group"
<<
m_configGroup
.
name
();
//
qDebug() << "deleting group" << m_configGroup.name();
m_configGroup
.
deleteGroup
();
}
...
...
konqueror/src/konqcombo.cpp
View file @
e62b3d9a
...
...
@@ -799,7 +799,7 @@ void KonqComboItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem
const
QSize
size
=
icon
.
actualSize
(
option
.
decorationSize
,
mode
);
QPixmap
pixmap
=
icon
.
pixmap
(
size
,
mode
);
QStyleOptionViewItem
V3
opt
(
option
);
QStyleOptionViewItem
opt
(
option
);
painter
->
save
();
...
...
konqueror/src/konqmain.cpp
View file @
e62b3d9a
...
...
@@ -41,16 +41,6 @@
#include <QDir>
#include <QStandardPaths>
static
void
listProfiles
()
{
QStringList
profiles
=
KGlobal
::
dirs
()
->
findAllResources
(
"data"
,
"konqueror/profiles/*"
,
KStandardDirs
::
NoDuplicates
);
profiles
.
sort
();
Q_FOREACH
(
const
QString
&
_file
,
profiles
)
{
const
QString
file
=
_file
.
mid
(
_file
.
lastIndexOf
(
'/'
)
+
1
);
printf
(
"%s
\n
"
,
QFile
::
encodeName
(
file
).
constData
());
}
}
static
void
listSessions
()
{
const
QString
dir
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
DataLocation
)
+
QLatin1Char
(
'/'
)
+
"sessions/"
;
...
...
@@ -94,9 +84,7 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
options
.
add
(
"preload"
,
ki18n
(
"Preload for later use. This mode does not support URLs on the command line"
));
options
.
add
(
"profile <profile>"
,
ki18n
(
"Profile to open"
));
options
.
add
(
"profiles"
,
ki18n
(
"List available profiles"
));
options
.
add
(
"profile <profile>"
,
ki18n
(
"Profile to open (DEPRECATED, IGNORED)"
));
options
.
add
(
"sessions"
,
ki18n
(
"List available sessions"
));
...
...
@@ -136,9 +124,6 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
if
(
!
tryPreload
())
{
return
0
;
// no preloading
}
}
else
if
(
args
->
isSet
(
"profiles"
))
{
listProfiles
();
return
0
;
}
else
if
(
args
->
isSet
(
"sessions"
))
{
listSessions
();
return
0
;
...
...
@@ -159,8 +144,7 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
}
else
if
(
args
->
count
()
==
0
)
{
// No args. If --silent, do nothing, otherwise create a default window.
if
(
!
args
->
isSet
(
"silent"
))
{
const
QString
profile
=
args
->
getOption
(
"profile"
);
KonqMainWindow
*
mainWin
=
KonqMisc
::
createBrowserWindowFromProfile
(
QString
(),
profile
);
KonqMainWindow
*
mainWin
=
KonqMisc
::
createNewWindow
();
mainWin
->
show
();
}
}
else
{
...
...
@@ -208,14 +192,7 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
req
.
tempFile
=
KCmdLineArgs
::
isTempFileSet
();
req
.
serviceName
=
args
->
getOption
(
"part"
);
KonqMainWindow
*
mainwin
=
0
;
if
(
args
->
isSet
(
"profile"
))
{
const
QString
profile
=
args
->
getOption
(
"profile"
);
//qDebug() << "main() -> createBrowserWindowFromProfile mimeType=" << urlargs.mimeType();
mainwin
=
KonqMisc
::
createBrowserWindowFromProfile
(
QString
(),
profile
,
firstUrl
,
req
);
}
else
{
mainwin
=
KonqMisc
::
createNewWindow
(
firstUrl
,
req
);
}
KonqMainWindow
*
mainwin
=
KonqMisc
::
createNewWindow
(
firstUrl
,
req
);
mainwin
->
show
();
if
(
!
urlList
.
isEmpty
())
{
// Open the other urls as tabs in that window
...
...
konqueror/src/konqmainwindow.cpp
View file @
e62b3d9a
...
...
@@ -30,6 +30,7 @@
#include "konqcloseditem.h"
#include "konqapplication.h"
#include "konqguiclients.h"
#include "konqmainwindowfactory.h"
#include "KonqMainWindowAdaptor.h"
#include "KonquerorAdaptor.h"
#include "konqview.h"
...
...
@@ -1297,16 +1298,14 @@ void KonqMainWindow::slotCreateNewWindow(const QUrl &url,
req
.
forceAutoEmbed
=
true
;
req
.
serviceName
=
preferredService
(
m_currentView
,
args
.
mimeType
());
// Pass the URL to createNewWindow so that it can select the right profile for it
// Note that it's always empty in case of window.open, though.
mainWindow
=
KonqMisc
::
createNewWindow
(
url
,
req
,
false
/*do not open URL*/
);
mainWindow
=
KonqMainWindowFactory
::
createEmptyWindow
();
mainWindow
->
resetAutoSaveSettings
();
// Don't autosave
// Do we know the mimetype? If not, go to generic openUrl which will use a KonqRun.
if
(
args
.
mimeType
().
isEmpty
())
{
mainWindow
->
openUrl
(
0
,
url
,
QString
(),
req
);
}
else
{
if
(
!
mainWindow
->
openView
(
args
.
mimeType
(),
url
,
m_currentView
,
req
))
{
if
(
!
mainWindow
->
openView
(
args
.
mimeType
(),
url
,
0
,
req
))
{
// we have problems. abort.
delete
mainWindow
;
...
...
@@ -1317,6 +1316,8 @@ void KonqMainWindow::slotCreateNewWindow(const QUrl &url,
}
}
qDebug
()
<<
"newWindow"
<<
mainWindow
<<
"currentView"
<<
mainWindow
->
currentView
()
<<
"views"
<<
mainWindow
->
viewMap
().
count
();
KonqView
*
view
=
0
;
// cannot use activePart/currentView, because the activation through the partmanager
// is delayed by a singleshot timer (see KonqViewManager::setActivePart)
...
...
@@ -1483,19 +1484,8 @@ void KonqMainWindow::slotCreateNewWindow(const QUrl &url,
void
KonqMainWindow
::
slotNewWindow
()
{
// Use profile from current window, if set
QString
profile
=
m_pViewManager
->
currentProfile
();
if
(
profile
.
isEmpty
())
{
if
(
m_currentView
&&
m_currentView
->
url
().
scheme
().
startsWith
(
"http"
))
{
profile
=
QLatin1String
(
"webbrowsing"
);
}
else
{
profile
=
QLatin1String
(
"filemanagement"
);
}
}
KonqMainWindow
*
mainWin
=
KonqMisc
::
createBrowserWindowFromProfile
(
QString
(),
profile
);
if
(
mainWin
)
{
mainWin
->
show
();
}
KonqMainWindow
*
mainWin
=
KonqMisc
::
createNewWindow
();
mainWin
->
show
();
}
void
KonqMainWindow
::
slotDuplicateWindow
()
...
...
@@ -2817,11 +2807,6 @@ KonqView *KonqMainWindow::otherView(KonqView *view) const
return
0
;
}
void
KonqMainWindow
::
slotSaveViewProfile
()
{
m_pViewManager
->
showProfileDlg
(
m_pViewManager
->
currentProfile
());
}
void
KonqMainWindow
::
slotUpAboutToShow
()
{
if
(
!
m_currentView
)
{
...
...
@@ -3709,10 +3694,6 @@ void KonqMainWindow::initActions()
// Settings menu
m_paSaveViewProfile
=
actionCollection
()
->
addAction
(
"saveviewprofile"
);
m_paSaveViewProfile
->
setText
(
i18n
(
"&Save View Profile As..."
));
connect
(
m_paSaveViewProfile
,
&
QAction
::
triggered
,
this
,
&
KonqMainWindow
::
slotSaveViewProfile
);
// This list is just for the call to authorizeControlModule; see slotConfigure for the real code
QStringList
configureModules
;
configureModules
<<
"khtml_general"
<<
"bookmarks"
<<
...
...
@@ -3820,14 +3801,6 @@ void KonqMainWindow::initActions()
connect
(
action
,
&
QAction
::
triggered
,
this
,
&
KonqMainWindow
::
slotDumpDebugInfo
);
#endif
m_paSaveRemoveViewProfile
=
actionCollection
()
->
addAction
(
"saveremoveviewprofile"
);
m_paSaveRemoveViewProfile
->
setText
(
i18n
(
"C&onfigure View Profiles..."
));
connect
(
m_paSaveRemoveViewProfile
,
&
QAction
::
triggered
,
m_pViewManager
,
&
KonqViewManager
::
slotProfileDlg
);
m_pamLoadViewProfile
=
new
KActionMenu
(
i18n
(
"Load &View Profile"
),
this
);
actionCollection
()
->
addAction
(
"loadviewprofile"
,
m_pamLoadViewProfile
);
m_pViewManager
->
setProfiles
(
m_pamLoadViewProfile
);
m_ptaFullScreen
=
KStandardAction
::
fullScreen
(
0
,
0
,
this
,
this
);
actionCollection
()
->
addAction
(
m_ptaFullScreen
->
objectName
(),
m_ptaFullScreen
);
QList
<
QKeySequence
>
fullScreenShortcut
=
m_ptaFullScreen
->
shortcuts
();
...
...
@@ -4343,12 +4316,6 @@ void KonqMainWindow::setProfileConfig(const KConfigGroup &cfg)
{
// Read toolbar settings and window size from profile, and autosave into that profile from now on
setAutoSaveSettings
(
cfg
);
currentProfileChanged
();
}
void
KonqMainWindow
::
currentProfileChanged
()
{
m_paSaveViewProfile
->
setEnabled
(
!
m_pViewManager
->
currentProfile
().
isEmpty
());
}
void
KonqMainWindow
::
enableAllActions
(
bool
enable
)
...
...
@@ -4375,11 +4342,6 @@ void KonqMainWindow::enableAllActions(bool enable)
m_paBack
->
setEnabled
(
false
);
m_paForward
->
setEnabled
(
false
);
// Load profile submenu
m_pViewManager
->
profileListDirty
(
false
);
currentProfileChanged
();
updateViewActions
();
// undo, lock, link and other view-dependent actions
updateClosedItemsAction
();
...
...
@@ -4432,9 +4394,6 @@ void KonqMainWindow::disableActionsNoView()
act
->
setEnabled
(
true
);
}
}
m_pamLoadViewProfile
->
setEnabled
(
true
);
m_paSaveViewProfile
->
setEnabled
(
true
);
m_paSaveRemoveViewProfile
->
setEnabled
(
true
);
m_combo
->
clearTemporary
();
}
...
...
@@ -4454,6 +4413,7 @@ void KonqMainWindow::setCaption(const QString &caption)
void
KonqMainWindow
::
showEvent
(
QShowEvent
*
event
)
{
//qDebug() << QTime::currentTime();
// We need to check if our toolbars are shown/hidden here, and set
// our menu items accordingly. We can't do it in the constructor because
// view profiles store toolbar info, and that info is read after
...
...
@@ -4474,11 +4434,6 @@ QUrl KonqExtendedBookmarkOwner::currentUrl() const
return
view
?
view
->
url
()
:
QUrl
();
}
QString
KonqMainWindow
::
currentProfile
()
const
{
return
m_pViewManager
->
currentProfile
();
}
QString
KonqMainWindow
::
currentURL
()
const
{
if
(
!
m_currentView
)
{
...
...
@@ -4937,7 +4892,7 @@ void KonqMainWindow::saveProperties(KConfigGroup &config)
// -> KSycoca running kbuildsycoca -> nested event loop.
if
(
m_fullyConstructed
)
{
KonqFrameBase
::
Options
flags
=
KonqFrameBase
::
saveHistoryItems
;
m_pViewManager
->
save
ViewProfile
ToGroup
(
config
,
flags
);
m_pViewManager
->
save
Config
ToGroup
(
config
,
flags
);
}
}
...
...
@@ -5254,7 +5209,6 @@ void KonqMainWindow::addClosedWindowToUndoList()
void
KonqMainWindow
::
updateWindowIcon
()
{
const
QString
url
=
m_combo
->
currentText
();
// TODO (kfm-devel email 13/09/2008) should we use a profile-defined icon instead of a url-dependent window icon?
const
QPixmap
pix
=
KonqPixmapProvider
::
self
()
->
pixmapFor
(
url
);
KParts
::
MainWindow
::
setWindowIcon
(
pix
);
...
...
konqueror/src/konqmainwindow.h
View file @
e62b3d9a
...
...
@@ -33,7 +33,6 @@
#include <kfileitem.h>
#include <kparts/mainwindow.h>
#include <kglobalsettings.h>
#include <kservice.h>
#include "konqcombo.h"
...
...
@@ -92,7 +91,6 @@ class KONQ_TESTS_EXPORT KonqMainWindow : public KParts::MainWindow, public KonqF
Q_PROPERTY
(
QString
currentTitle
READ
currentTitle
)
Q_PROPERTY
(
QString
currentURL
READ
currentURL
)
Q_PROPERTY
(
bool
isHTMLAllowed
READ
isHTMLAllowed
)
Q_PROPERTY
(
QString
currentProfile
READ
currentProfile
)
public:
enum
ComboAction
{
ComboClear
,
ComboAdd
,
ComboRemove
};
enum
PageSecurity
{
NotCrypted
,
Encrypted
,
Mixed
};
...
...
@@ -277,7 +275,6 @@ public:
* so we should save mainwindow settings into that file from now on
*/
void
setProfileConfig
(
const
KConfigGroup
&
cfg
);
void
currentProfileChanged
();
// operates on all combos of all mainwindows of this instance
// up to now adds an entry or clears all entries
...
...
@@ -346,7 +343,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
;
QString
currentProfile
()
const
;
void
applyWindowSizeFromProfile
(
const
KConfigGroup
&
profileGroup
);
void
updateHistoryActions
();
...
...
@@ -469,8 +465,6 @@ private Q_SLOTS:
void
slotDumpDebugInfo
();
void
slotSaveViewProfile
();
void
slotOpenEmbedded
(
KService
::
Ptr
);
// Connected to KGlobalSettings
...
...
@@ -645,8 +639,6 @@ private: // members
KActionMenu
*
m_paSessions
;
QAction
*
m_paHome
;
QAction
*
m_paSaveViewProfile
;
QAction
*
m_paSplitViewHor
;
QAction
*
m_paSplitViewVer
;
QAction
*
m_paAddTab
;
...
...
@@ -658,9 +650,6 @@ private: // members
QAction
*
m_paActivateNextTab
;
QAction
*
m_paActivatePrevTab
;
QAction
*
m_paSaveRemoveViewProfile
;
KActionMenu
*
m_pamLoadViewProfile
;
KToggleAction
*
m_paLockView
;
KToggleAction
*
m_paLinkView
;
QAction
*
m_paReload
;
...
...
konqueror/src/konqmainwindowfactory.cpp
0 → 100644
View file @
e62b3d9a
/* This file is part of the KDE project
Copyright (C) 1998, 1999, 2016 David Faure <faure@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "konqmainwindowfactory.h"
#include "konqmainwindow.h"
#include "konqsessionmanager.h"
#include <KWindowInfo>
#include <KStartupInfo>
// Terminates fullscreen-mode for any full-screen window on the current desktop
static
void
abortFullScreenMode
()
{
QList
<
KonqMainWindow
*>
*
mainWindows
=
KonqMainWindow
::
mainWindowList
();
if
(
mainWindows
)
{
foreach
(
KonqMainWindow
*
window
,
*
mainWindows
)
{
if
(
window
->
fullScreenMode
())
{
KWindowInfo
info
(
window
->
winId
(),
NET
::
WMDesktop
);
if
(
info
.
valid
()
&&
info
.
isOnCurrentDesktop
())
{
window
->
setWindowState
(
window
->
windowState
()
&
~
Qt
::
WindowFullScreen
);
}
}
}
}
}
KonqMainWindow
*
KonqMainWindowFactory
::
createEmptyWindow
()
{
abortFullScreenMode
();
// Ask the user to recover session if applicable
if
(
KonqSessionManager
::
self
()
->
askUserToRestoreAutosavedAbandonedSessions
())
{
QList
<
KonqMainWindow
*>
*
mainWindowList
=
KonqMainWindow
::
mainWindowList
();
if
(
mainWindowList
&&
!
mainWindowList
->
isEmpty
())
{
return
mainWindowList
->
first
();
}
else
{
// This should never happen but just to be sure
return
new
KonqMainWindow
;
}
}
else
if
(
KonqMainWindow
::
isPreloaded
()
&&
KonqMainWindow
::
preloadedWindow
()
!=
NULL
)
{
KonqMainWindow
*
mainWindow
=
KonqMainWindow
::
preloadedWindow
();
KStartupInfo
::
setWindowStartupId
(
mainWindow
->
winId
(),
KStartupInfo
::
startupId
());
KonqMainWindow
::
setPreloadedWindow
(
NULL
);
KonqMainWindow
::
setPreloadedFlag
(
false
);
mainWindow
->
resetWindow
();
mainWindow
->
reparseConfiguration
();
return
mainWindow
;
}
return
new
KonqMainWindow
;
}
konqueror/src/konqmainwindowfactory.h
0 → 100644
View file @
e62b3d9a
/* This file is part of the KDE project
Copyright (C) 1998, 1999, 2016 David Faure <faure@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KONQMAINWINDOWFACTORY_H
#define KONQMAINWINDOWFACTORY_H
class
KonqMainWindow
;
class
QUrl
;
namespace
KonqMainWindowFactory
{
/**
* Create a new empty window.
* This layer on top of the KonqMainWindow constructor allows to reuse preloaded windows,
* and offers restoring windows after a crash.
* Note: the caller must call show()