Commit bc87b353 authored by David Faure's avatar David Faure

Almost finish the port to KF5. Sonnet::ConfigDialog is the last hurdle, asked for help.

parent 7eef62e6
add_definitions(-D_LARGEFILE64_SOURCE )
find_package(KF5 REQUIRED COMPONENTS Parts KCMUtils)
find_package(KF5 REQUIRED COMPONENTS Parts KCMUtils KHtml)
if(Q_WS_X11)
find_package(X11 REQUIRED) # both subdirs require the X11 libs
......
......@@ -111,6 +111,11 @@ target_link_libraries(kdeinit_konqueror
KF5::Parts
KF5::KDELibs4Support
)
# For khtmldefaults.h. We don't need to link to khtml, just to include that header...
get_target_property(khtml_include_dir KF5::KHtml INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(kdeinit_konqueror PRIVATE "${khtml_include_dir}")
if (UNIX)
target_link_libraries(kdeinit_konqueror ${X11_LIBRARIES})
endif (UNIX)
......
......@@ -28,18 +28,20 @@
#include <QEvent>
#include <QFile>
#include <QRegExp>
#include <QMenu>
#include <ktoolbar.h>
#include <kactionmenu.h>
#include <kconfig.h>
#include <kglobal.h>
#include <kmenu.h>
#include <kdebug.h>
#include <kconfiggroup.h>
#include <kio/global.h>
#include <kbookmarkmanager.h>
#include "konqbookmarkmenu.h"
#include "kbookmarkimporter.h"
#include "kbookmarkaction.h"
#include "kbookmarkdombuilder.h"
......@@ -47,7 +49,7 @@
class KBookmarkBarPrivate
{
public:
QList<KAction *> m_actions;
QList<QAction *> m_actions;
int m_sepIndex;
QList<int> widgetPositions; //right edge, bottom edge
QString tempLabel;
......@@ -88,7 +90,7 @@ KBookmarkBar::KBookmarkBar( KBookmarkManager* mgr,
KBookmarkGroup toolbar = getToolbar();
fillBookmarkBar( toolbar );
m_toolBarSeparator = new KAction(this);
m_toolBarSeparator = new QAction(this);
}
QString KBookmarkBar::parentAddress()
......@@ -193,7 +195,7 @@ void KBookmarkBar::fillBookmarkBar(const KBookmarkGroup & parent)
}
else
{
KAction *action = new KBookmarkAction( bm, m_pOwner, 0 );
QAction *action = new KBookmarkAction( bm, m_pOwner, 0 );
if (m_toolBar) {
m_toolBar->addAction(action);
}
......@@ -229,7 +231,7 @@ void KBookmarkBar::removeTempSep()
* @param actions the list of actions plugged into the bar
* returned action was dropped on
*/
bool KBookmarkBar::handleToolbarDragMoveEvent(const QPoint& p, const QList<KAction *>& actions, const QString &text)
bool KBookmarkBar::handleToolbarDragMoveEvent(const QPoint& p, const QList<QAction *>& actions, const QString &text)
{
if(d->m_filteredToolbar)
return false;
......@@ -321,7 +323,7 @@ void KBookmarkBar::contextMenu(const QPoint & pos)
}
else
{
KMenu * menu = new KonqBookmarkContextMenu(action->bookmark(), m_pManager, m_pOwner);
QMenu * menu = new KonqBookmarkContextMenu(action->bookmark(), m_pManager, m_pOwner);
menu->setAttribute(Qt::WA_DeleteOnClose);
menu->popup(m_toolBar->mapToGlobal(pos));
}
......@@ -356,7 +358,7 @@ bool KBookmarkBar::eventFilter( QObject *, QEvent *e )
if(d->m_sepIndex == 0)
{
KBookmark newBookmark = parentBookmark.addBookmark(toInsert.fullText(), toInsert.url() );
KBookmark newBookmark = parentBookmark.addBookmark(toInsert.fullText(), toInsert.url(), KIO::iconNameForUrl(toInsert.url()) );
parentBookmark.moveBookmark( newBookmark, KBookmark() );
m_pManager->emitChanged( parentBookmark );
......@@ -368,7 +370,7 @@ bool KBookmarkBar::eventFilter( QObject *, QEvent *e )
for(int i=0; i < d->m_sepIndex - 1 ; ++i)
after = parentBookmark.next(after);
KBookmark newBookmark = parentBookmark.addBookmark(toInsert.fullText(), toInsert.url() );
KBookmark newBookmark = parentBookmark.addBookmark(toInsert.fullText(), toInsert.url(), KIO::iconNameForUrl(toInsert.url()) );
parentBookmark.moveBookmark( newBookmark, after );
m_pManager->emitChanged( parentBookmark );
......@@ -388,7 +390,7 @@ bool KBookmarkBar::eventFilter( QObject *, QEvent *e )
const QList<KBookmark> list = KBookmark::List::fromMimeData( dme->mimeData(), doc );
if ( list.isEmpty() )
return false;
d->tempLabel = list.first().url().pathOrUrl();
d->tempLabel = list.first().url().toDisplayString(QUrl::PreferLocalFile);
d->widgetPositions.clear();
......
......@@ -25,13 +25,11 @@
#include <QtCore/QPointer>
#include <QtCore/QList>
#include <kbookmark.h>
#include <kaction.h>
#include <kactioncollection.h>
class KToolBar;
class KBookmarkMenu;
class KBookmarkOwner;
class KActionCollection;
class KAction;
class KBookmarkBarPrivate;
/**
......@@ -77,7 +75,7 @@ protected:
private:
KBookmarkGroup getToolbar();
void removeTempSep();
bool handleToolbarDragMoveEvent(const QPoint& pos, const QList<KAction *>& actions, const QString &text);
bool handleToolbarDragMoveEvent(const QPoint& pos, const QList<QAction *>& actions, const QString &text);
KBookmarkOwner *m_pOwner;
QPointer<KToolBar> m_toolBar;
......
......@@ -140,7 +140,7 @@ void KonqClosedRemoteWindowItem::readConfig() const
if(m_remoteConfig || m_remoteConfigGroup)
return;
m_remoteConfig = new KConfig( m_remoteConfigFileName, KConfig::SimpleConfig, "tmp");
m_remoteConfig = new KConfig( m_remoteConfigFileName, KConfig::SimpleConfig);
m_remoteConfigGroup = new KConfigGroup(m_remoteConfig, m_remoteGroupName);
kDebug();
}
......
......@@ -66,7 +66,7 @@ KonqClosedWindowsManager::KonqClosedWindowsManager()
m_konqClosedItemsConfig = 0L;
m_blockClosedItems = false;
m_konqClosedItemsStore = new KConfig(filename, KConfig::SimpleConfig, "tmp");
m_konqClosedItemsStore = new KConfig(file, KConfig::SimpleConfig);
}
KonqClosedWindowsManager::~KonqClosedWindowsManager()
......@@ -183,10 +183,6 @@ bool isSenderOfSignal( const QString& service )
void KonqClosedWindowsManager::emitNotifyClosedWindowItem(
const KonqClosedWindowItem *closedWindowItem)
{
QString filename = "closeditems/" + KonqMisc::encodeFilename(QDBusConnection::sessionBus().baseService());
QString file = KStandardDirs::locateLocal("tmp", filename);
emit notifyClosedWindowItem( closedWindowItem->title(),
closedWindowItem->numTabs(),
m_konqClosedItemsStore->name(),
......@@ -356,7 +352,7 @@ void KonqClosedWindowsManager::saveConfig()
QString file = KStandardDirs::locateLocal("appdata", filename);
QFile::remove(file);
KConfig *config = new KConfig(filename, KConfig::SimpleConfig, "appdata");
KConfig *config = new KConfig(file, KConfig::SimpleConfig);
// Populate the config file
KonqClosedWindowItem* closedWindowItem = 0L;
......
......@@ -74,8 +74,8 @@ KonqExtensionManager::KonqExtensionManager(QWidget *parent, KonqMainWindow *main
d->pluginSelector->addPlugins("konqueror", i18n("Extensions"), "Extensions", KGlobal::config());
if ( activePart ) {
KAboutData componentData = activePart->componentData();
d->pluginSelector->addPlugins(componentData.componentName(), i18n("Extensions"), "Tools", componentData.config());
d->pluginSelector->addPlugins(componentData.componentName(), i18n("Extensions"), "Statusbar", componentData.config());
d->pluginSelector->addPlugins(componentData.componentName(), i18n("Extensions"), "Tools");
d->pluginSelector->addPlugins(componentData.componentName(), i18n("Extensions"), "Statusbar");
}
connect( this, SIGNAL(okClicked()), SLOT(slotOk()) );
......@@ -109,7 +109,7 @@ void KonqExtensionManager::apply()
if( d->mainWindow )
{
KParts::Plugin::loadPlugins(d->mainWindow, d->mainWindow, KGlobal::mainComponent());
KParts::Plugin::loadPlugins(d->mainWindow, d->mainWindow, "konqueror");
QList<KParts::Plugin*> plugins = KParts::Plugin::pluginObjects(d->mainWindow);
for (int i = 0; i < plugins.size(); ++i) {
......@@ -119,7 +119,7 @@ void KonqExtensionManager::apply()
if ( d->activePart )
{
KParts::Plugin::loadPlugins( d->activePart, d->activePart, d->activePart->componentData() );
KParts::Plugin::loadPlugins(d->activePart, d->activePart, d->activePart->componentName());
QList<KParts::Plugin*> plugins = KParts::Plugin::pluginObjects( d->activePart );
for (int i = 0; i < plugins.size(); ++i) {
......
......@@ -35,6 +35,8 @@
#include <kaction.h>
#include <kactioncollection.h>
#include <kguiitem.h>
#include <kglobal.h>
#include <kicon.h>
#include <klocale.h>
#include <klineedit.h>
#include <ktoggleaction.h>
......
......@@ -122,6 +122,7 @@
#include <kurlrequester.h>
#include <kmimetypetrader.h>
#include <kwindowsystem.h>
#include <KJobWidgets>
#include <kfiledialog.h>
#include <klocale.h>
#include <kicon.h>
......@@ -131,7 +132,9 @@
#include <kio/scheduler.h>
#include <kio/netaccess.h>
#include <KIO/JobUiDelegate>
#include <KIO/CopyJob>
#include <KIO/Job>
#include <KIO/FileUndoManager>
#include <kparts/browseropenorsavequestion.h>
#include <KParts/OpenUrlEvent>
#include <KParts/BrowserHostExtension>
......@@ -2696,7 +2699,7 @@ void KonqMainWindow::slotDumpDebugInfo()
#endif
}
bool KonqMainWindow::askForTarget(const KLocalizedString& text, KUrl& url)
bool KonqMainWindow::askForTarget(const KLocalizedString& text, QUrl& url)
{
const KUrl initialUrl = (viewCount()==2) ? otherView(m_currentView)->url() : m_currentView->url();
QString label = text.subs( m_currentView->url().pathOrUrl() ).toString();
......@@ -2719,20 +2722,26 @@ bool KonqMainWindow::askForTarget(const KLocalizedString& text, KUrl& url)
void KonqMainWindow::slotCopyFiles()
{
KUrl dest;
QUrl dest;
if (!askForTarget(ki18n("Copy selected files from %1 to:"), dest))
return;
KonqOperations::copy(this, KonqOperations::COPY, currentURLs(), dest);
KIO::CopyJob* job = KIO::copy(currentURLs(), dest);
KIO::FileUndoManager::self()->recordCopyJob(job);
KJobWidgets::setWindow(job, this);
job->ui()->setAutoErrorHandlingEnabled(true);
}
void KonqMainWindow::slotMoveFiles()
{
KUrl dest;
QUrl dest;
if (!askForTarget(ki18n("Move selected files from %1 to:"), dest))
return;
KonqOperations::copy(this, KonqOperations::MOVE, currentURLs(), dest);
KIO::CopyJob* job = KIO::move(currentURLs(), dest);
KIO::FileUndoManager::self()->recordCopyJob(job);
KJobWidgets::setWindow(job, this);
job->ui()->setAutoErrorHandlingEnabled(true);
}
KUrl::List KonqMainWindow::currentURLs() const
......@@ -4502,7 +4511,7 @@ QList<KBookmarkOwner::FutureBookmark> KonqExtendedBookmarkOwner::currentBookmark
KonqView *view = frame->activeChildView();
if( view->locationBarURL().isEmpty() )
continue;
list << KBookmarkOwner::FutureBookmark(view->caption(), view->url(), QString() /* TODO view->icon() ? */);
list << KBookmarkOwner::FutureBookmark(view->caption(), view->url(), KIO::iconNameForUrl(view->url()));
}
return list;
}
......
......@@ -539,7 +539,7 @@ protected:
virtual void closeEvent( QCloseEvent * );
bool askForTarget(const KLocalizedString& text, KUrl& url);
bool askForTarget(const KLocalizedString& text, QUrl& url);
private Q_SLOTS:
void slotUndoTextChanged(const QString& newText);
......
......@@ -35,6 +35,7 @@
#include <klocale.h>
#include <kdialog.h>
#include <kurl.h>
#include <kicon.h>
#include <ktempdir.h>
#include <ksqueezedtextlabel.h>
......@@ -414,7 +415,7 @@ void KonqSessionManager::enableAutosave()
const QString filePath = KStandardDirs::locateLocal("appdata", filename);
delete m_sessionConfig;
m_sessionConfig = new KConfig(filePath, KConfig::SimpleConfig, "appdata");
m_sessionConfig = new KConfig(filePath, KConfig::SimpleConfig);
//kDebug() << "config filename:" << m_sessionConfig->name();
m_autosaveEnabled = true;
......@@ -471,7 +472,7 @@ void KonqSessionManager::slotSaveCurrentSession(const QString & path)
void KonqSessionManager::saveCurrentSessionToFile(const QString& sessionConfigPath)
{
QFile::remove(sessionConfigPath);
KConfig config(sessionConfigPath, KConfig::SimpleConfig, "appdata");
KConfig config(sessionConfigPath, KConfig::SimpleConfig);
saveCurrentSessionToFile(&config);
}
......
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