Commit 1a62207c authored by Jonathan Marten's avatar Jonathan Marten Committed by Stefano Crocco
Browse files

Port and update the Konqueror core (client, libkonq, src)

Note that this change must be applied after all of the others
that remove KDELibs4Support, otherwise the build will fail.

kDebug(), qDebug() -> qCDebug() with logging category
No need to link with KDELibs4Support
QDrag::start() -> QDrag::exec() with explicit argument
Window title and action icon for "Configure Extensions"
parent 43d36acc
......@@ -25,13 +25,13 @@ include(ECMSetupVersion)
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
include(CMakePackageConfigHelpers)
include(GenerateExportHeader)
set(KONQUEROR_LIB_VERSION "${RELEASE_SERVICE_VERSION}")
set(KONQUEROR_VERSION "${KONQUEROR_LIB_VERSION}")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Widgets WebEngineWidgets)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Parts KCMUtils Archive Crash WindowSystem Init IconThemes DBusAddons)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS KDELibs4Support)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Parts KCMUtils Archive Crash WindowSystem Init IconThemes DBusAddons GuiAddons)
find_package(KF5 ${KF5_MIN_VERSION} COMPONENTS Activities DocTools) # Optional
......
......@@ -7,6 +7,8 @@ set(kfmclient_SRCS
konqclientrequest.cpp
)
ecm_qt_declare_logging_category(kfmclient_SRCS HEADER kfmclient_debug.h IDENTIFIER KFMCLIENT_LOG CATEGORY_NAME org.kde.kfmclient)
qt5_add_dbus_interface( kfmclient_SRCS ../src/org.kde.Konqueror.Main.xml konq_main_interface )
qt5_add_dbus_interface( kfmclient_SRCS ../src/org.kde.Konqueror.MainWindow.xml konq_mainwindow_interface )
......
......@@ -19,8 +19,6 @@
#include "kfmclient.h"
#include <konqclientrequest.h>
#include <ktoolinvocation.h>
#include <kio/job.h>
#include <kio/jobuidelegate.h>
......@@ -46,7 +44,6 @@
#include <kcoreaddons_version.h>
#include <QApplication>
#include <QDebug>
#include <QDBusConnection>
#include <QDir>
#include <QMimeDatabase>
......@@ -63,6 +60,9 @@
#include <process.h>
#endif
#include "konqclientrequest.h"
#include "kfmclient_debug.h"
static const char appName[] = "kfmclient";
static const char programName[] = I18N_NOOP("kfmclient");
static const char description[] = I18N_NOOP("KDE tool for opening URLs from the command line");
......@@ -79,7 +79,7 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
QCommandLineParser parser;
aboutData.setupCommandLine(&parser);
//qDebug() << "kfmclient starting" << QTime::currentTime();
//qCDebug(KFMCLIENT_LOG) << "kfmclient starting" << QTime::currentTime();
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("noninteractive"), i18n("Non interactive use: no message boxes")));
......@@ -119,7 +119,7 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
&& qEnvironmentVariableIsSet("KDE_FULL_SESSION")) {
const int version = atoi(getenv("KDE_SESSION_VERSION"));
if (version != 0 && version != KCOREADDONS_VERSION_MAJOR) {
qDebug() << "Forwarding to kfmclient from KDE version " << version;
qCDebug(KFMCLIENT_LOG) << "Forwarding to kfmclient from KDE version " << version;
char wrapper[ 10 ];
sprintf(wrapper, "kde%d", version);
char **newargv = new char *[ argc + 2 ];
......@@ -175,7 +175,7 @@ ClientApp::ClientApp()
bool ClientApp::createNewWindow(const QUrl &url, bool newTab, bool tempFile, const QString &mimetype)
{
qDebug() << url << "mimetype=" << mimetype;
qCDebug(KFMCLIENT_LOG) << url << "mimetype=" << mimetype;
if (url.scheme().startsWith(QLatin1String("http"))) {
KConfig config(QStringLiteral("kfmclientrc"));
......@@ -183,7 +183,7 @@ bool ClientApp::createNewWindow(const QUrl &url, bool newTab, bool tempFile, con
const QString browserApp = generalGroup.readEntry("BrowserApplication");
if (!browserApp.isEmpty() && !browserApp.startsWith(QLatin1String("!kfmclient"))
&& (browserApp.startsWith('!') || KService::serviceByStorageId(browserApp))) {
qDebug() << "Using external browser" << browserApp;
qCDebug(KFMCLIENT_LOG) << "Using external browser" << browserApp;
KStartupInfo::appStarted();
KIO::OpenUrlJob *job = new KIO::OpenUrlJob(url);
......
......@@ -38,6 +38,8 @@
#include <KStartupInfo>
#include <KWindowSystem>
#include "kfmclient_debug.h"
class KonqClientRequestPrivate
{
public:
......@@ -148,9 +150,9 @@ bool KonqClientRequest::openUrl()
#endif
KStartupInfo::resetStartupEnv();
if (ok) {
qDebug() << "Konqueror started, pid=" << pid;
qCDebug(KFMCLIENT_LOG) << "Konqueror started, pid=" << pid;
} else {
qWarning() << "Error starting konqueror";
qCWarning(KFMCLIENT_LOG) << "Error starting konqueror";
}
return ok;
}
......
......@@ -10,9 +10,10 @@ set(konq_LIB_SRCS
konq_historyprovider.cpp # konqueror and konqueror/sidebar
)
ecm_qt_declare_logging_category(konq_LIB_SRCS HEADER libkonq_debug.h IDENTIFIER LIBKONQ_LOG CATEGORY_NAME org.kde.libkonq)
add_library(KF5Konq ${konq_LIB_SRCS})
include(GenerateExportHeader)
generate_export_header(KF5Konq BASE_NAME libkonq EXPORT_FILE_NAME libkonq_export.h)
add_library(KF5::Konq ALIAS KF5Konq)
......
......@@ -21,13 +21,14 @@
#include "konq_historyloader_p.h"
#include "konq_historyentry.h"
#include <QDebug>
#include <QDataStream>
#include <QFile>
#include <QStandardPaths>
#include <zlib.h> // for crc32
#include "libkonq_debug.h"
class KonqHistoryLoaderPrivate
{
public:
......@@ -62,7 +63,7 @@ bool KonqHistoryLoader::loadHistory()
QFile file(filename);
if (!file.open(QIODevice::ReadOnly)) {
if (file.exists()) {
qWarning() << "Can't open" << filename;
qCWarning(LIBKONQ_LOG) << "Can't open" << filename;
}
return false;
}
......@@ -115,7 +116,7 @@ bool KonqHistoryLoader::loadHistory()
#endif
if (historyVersion() != int(version) || (crcChecked && !crcOk)) {
qWarning() << "The history version doesn't match, aborting loading";
qCWarning(LIBKONQ_LOG) << "The history version doesn't match, aborting loading";
file.close();
return false;
}
......@@ -123,11 +124,11 @@ bool KonqHistoryLoader::loadHistory()
while (!stream->atEnd()) {
KonqHistoryEntry entry;
entry.load(*stream, flags);
// kDebug(1202) << "loaded entry:" << entry.url << ", Title:" << entry.title;
// qCDebug(LIBKONQ_LOG) << "loaded entry:" << entry.url << ", Title:" << entry.title;
d->m_history.append(entry);
}
//kDebug(1202) << "loaded:" << m_history.count() << "entries.";
//qCDebug(LIBKONQ_LOG) << "loaded:" << m_history.count() << "entries.";
std::sort(d->m_history.begin(), d->m_history.end(), lastVisitedOrder);
}
......
......@@ -31,12 +31,13 @@
#include <QDBusMessage>
#include <QDataStream>
#include <QDir>
#include <QDebug>
#include <QSaveFile>
#include <QStandardPaths>
#include <zlib.h> // for crc32
#include "libkonq_debug.h"
class KonqHistoryProviderPrivate : public QObject, QDBusContext
{
Q_OBJECT
......@@ -272,7 +273,7 @@ void KonqHistoryProviderPrivate::slotNotifyHistoryEntry(const QByteArray &data)
//some "old" copies may still running, we use the old format for the DBUS transfers.
//This doesn't make that much difference performance-wise for single entries anyway.
e.load(stream, KonqHistoryEntry::MarshalUrlAsStrings);
//kDebug(1202) << "Got new entry from Broadcast:" << e.url;
//qCDebug(LIBKONQ_LOG) << "Got new entry from Broadcast:" << e.url;
KonqHistoryList::iterator existingEntry = q->findEntry(e.url);
QString urlString = e.url.url();
......@@ -411,7 +412,7 @@ bool KonqHistoryProviderPrivate::saveHistory()
const QString filename = dir + QLatin1String("/konq_history");
QSaveFile file(filename);
if (!file.open(QIODevice::WriteOnly)) {
qWarning() << "Can't open" << file.fileName() << "for saving history";
qCWarning(LIBKONQ_LOG) << "Can't open" << file.fileName() << "for saving history";
return false;
}
......
......@@ -198,8 +198,8 @@ void KonqPopupMenuPrivate::populate()
isSymLinkInSameDir = !firstPopupItem.linkDest().contains(QLatin1Char('/'));
}
QUrl firstPopupURL(firstPopupItem.url().adjusted(QUrl::NormalizePathSegments));
//kDebug(1203) << "View path is " << url.url();
//kDebug(1203) << "First popup path is " << firstPopupURL.url();
//qCDebug(LIBKONQ_LOG) << "View path is " << url.url();
//qCDebug(LIBKONQ_LOG) << "First popup path is " << firstPopupURL.url();
currentDir = (firstPopupURL.matches(url, QUrl::StripTrailingSlash));
if (firstPopupItem.isDesktopFile()) {
KDesktopFile desktopFile(firstPopupItem.localPath());
......@@ -221,7 +221,7 @@ void KonqPopupMenuPrivate::populate()
const bool bIsLink = (m_popupFlags & KonqPopupMenu::IsLink);
//kDebug() << "isLocal=" << isLocal << " url=" << url << " isCurrentTrash=" << isCurrentTrash << " isIntoTrash=" << isIntoTrash << " bTrashIncluded=" << bTrashIncluded;
//qCDebug(LIBKONQ_LOG) << "isLocal=" << isLocal << " url=" << url << " isCurrentTrash=" << isCurrentTrash << " isIntoTrash=" << isIntoTrash << " bTrashIncluded=" << bTrashIncluded;
//////////////////////////////////////////////////////////////////////////
......@@ -458,7 +458,7 @@ void KonqPopupMenuPrivate::populate()
KonqPopupMenu::~KonqPopupMenu()
{
delete d;
//kDebug(1203) << "~KonqPopupMenu leave";
//qCDebug(LIBKONQ_LOG) << "~KonqPopupMenu leave";
}
void KonqPopupMenu::setNewFileMenu(KNewFileMenu *newMenu)
......
......@@ -40,7 +40,6 @@ endif(X11_FOUND)
set_target_properties(konquerorprivate PROPERTIES VERSION ${KONQUEROR_LIB_VERSION} SOVERSION "5" )
install(TARGETS konquerorprivate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
include(GenerateExportHeader)
generate_export_header(konquerorprivate BASE_NAME konquerorprivate EXPORT_FILE_NAME konquerorprivate_export.h)
########### konqueror ###############
......
......@@ -610,7 +610,7 @@ void KonqCombo::mouseMoveEvent(QMouseEvent *e)
if (!pix.isNull()) {
drag->setPixmap(pix);
}
drag->start();
drag->exec(Qt::CopyAction);
}
}
}
......
......@@ -55,7 +55,7 @@ KonqExtensionManager::KonqExtensionManager(QWidget *parent, KonqMainWindow *main
: QDialog(parent)
{
setObjectName(QStringLiteral("extensionmanager"));
setWindowTitle(i18nc("@title:window", "Configure"));
setWindowTitle(i18nc("@title:window", "Configure Extensions"));
QVBoxLayout *mainLayout = new QVBoxLayout(this);
......
......@@ -3575,6 +3575,7 @@ void KonqMainWindow::initActions()
actionCollection()->addAction(KStandardAction::ConfigureToolbars, this, SLOT(slotConfigureToolbars()));
m_paConfigureExtensions = actionCollection()->addAction(QStringLiteral("options_configure_extensions"));
m_paConfigureExtensions->setIcon(QIcon::fromTheme(QStringLiteral("plugins")));
m_paConfigureExtensions->setText(i18n("Configure Extensions..."));
connect(m_paConfigureExtensions, &QAction::triggered, this, &KonqMainWindow::slotConfigureExtensions);
m_paConfigureSpellChecking = actionCollection()->addAction(QStringLiteral("configurespellcheck"));
......
......@@ -1309,8 +1309,7 @@ void KonqViewManager::printSizeInfo(KonqFrameBase *frame,
const char *msg)
{
const QRect r = frame->asQWidget()->geometry();
qDebug("Child size %s : x: %d, y: %d, w: %d, h: %d", msg, r.x(), r.y(), r.width(), r.height());
qCDebug(KONQUEROR_LOG) << "Child size" << msg << r;
if (parent->frameType() == KonqFrameBase::Container) {
const QList<int> sizes = static_cast<KonqFrameContainer *>(parent)->sizes();
printf("Parent sizes %s :", msg);
......
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