Commit cc315848 authored by Christoph Cullmann's avatar Christoph Cullmann

get to compile without KDE 4 support

parent e452b081
......@@ -52,9 +52,16 @@ find_package(KF5 CONFIG REQUIRED COMPONENTS
Sonnet
WindowSystem
XmlGui
KDE4Support # TODO: waiting for Title case include files
)
# use sane compile flags
include (KDECompilerSettings)
add_definitions (-DQT_STRICT_ITERATORS
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
-DQT_USE_FAST_CONCATENATION
-DQT_USE_FAST_OPERATOR_PLUS
)
# config.h
if(NOT APPLE)
check_function_exists (fdatasync HAVE_FDATASYNC)
......@@ -63,17 +70,6 @@ endif(NOT APPLE)
configure_file (config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
# enforce build of tests
set (KDE4_BUILD_TESTS "ON" CACHE "BOOL" "Enable building of tests" FORCE)
# KDE/QT definitions we want
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
add_definitions (-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
# Temporary solution until the split frameworks provide forward headers
get_target_property (KDE4Support_INCLUDES KF5::KDE4Support INTERFACE_INCLUDE_DIRECTORIES)
include_directories(${KDE4Support_INCLUDES})
# let our config.h and local ktexteditor stuff be found first in any case
include_directories (BEFORE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/ktexteditor/include ${CMAKE_CURRENT_BINARY_DIR}/ktexteditor/include/KTextEditor)
......
......@@ -50,7 +50,7 @@ class KateBtBrowserPlugin: public Kate::Plugin, public KTextEditor::ConfigPageIn
void startIndexer();
signals:
Q_SIGNALS:
void newStatus(const QString&);
//
......@@ -86,14 +86,14 @@ class KateBtBrowserPluginView : public Kate::PluginView, public Ui::BtBrowserWid
void loadBacktrace(const QString& bt);
public slots:
public Q_SLOTS:
void loadFile();
void loadClipboard();
void configure();
void clearStatus();
void setStatus(const QString& status);
private slots:
private Q_SLOTS:
void itemActivated(QTreeWidgetItem* item, int column);
private:
......@@ -109,12 +109,12 @@ class KateBtConfigWidget : public KTextEditor::ConfigPage, private Ui::BtConfigW
explicit KateBtConfigWidget(QWidget* parent = 0, const char* name = 0);
virtual ~KateBtConfigWidget();
public slots:
public Q_SLOTS:
virtual void apply();
virtual void reset();
virtual void defaults();
private slots:
private Q_SLOTS:
void add();
void remove();
void textChanged();
......@@ -130,7 +130,7 @@ class KateBtConfigDialog : public KDialog
KateBtConfigDialog(QWidget* parent = 0);
~KateBtConfigDialog();
public slots:
public Q_SLOTS:
void changed();
private:
......
......@@ -153,7 +153,7 @@ class KateTemplateInfoWidget : public QWidget
class KIconButton *ibIcon;
class QString highlightName;
private slots:
private Q_SLOTS:
void slotHlSet( class QAction *action );
private:
......@@ -182,10 +182,10 @@ class KateTemplateWizard : public QWizard
virtual int nextId() const;
public slots:
public Q_SLOTS:
void accept();
private slots:
private Q_SLOTS:
void slotTmplateSet( class QAction* );
void slotStateChanged();
void slotStateChanged( int ) { slotStateChanged(); }
......@@ -221,12 +221,12 @@ class KateTemplateManager : public QWidget
explicit KateTemplateManager( KateFileTemplates *kft=0, QWidget *parent=0 );
~KateTemplateManager() {}
public slots:
public Q_SLOTS:
void apply();
void reload();
void reset() { reload(); }
private slots:
private Q_SLOTS:
void slotUpdateState();
void slotEditTemplate();
void slotRemoveTemplate();
......
......@@ -47,7 +47,7 @@ class SelectTargetDialog : public KDialog
protected:
virtual bool eventFilter(QObject *obj, QEvent *event);
private slots:
private Q_SLOTS:
void slotFilterTargets(const QString& filter);
void slotCurrentItemChanged(QListWidgetItem* currentItem);
void slotTargetSetSelected(int index);
......
......@@ -35,7 +35,7 @@ public:
int cacheCapacity() const;
public slots:
public Q_SLOTS:
void clearCache();
void setCacheCapacity(int);
......
......@@ -28,7 +28,7 @@ class DataOutputView : public QTableView
public:
DataOutputView(QWidget *parent = 0);
private slots:
private Q_SLOTS:
void slotCustomContextMenuRequested(const QPoint &pos);
};
......
......@@ -52,7 +52,7 @@ class DataOutputWidget : public QWidget
DataOutputModel *model() const { return m_model; }
DataOutputView *view() const { return m_view; }
public slots:
public Q_SLOTS:
void showQueryResultSets(QSqlQuery &query);
void resizeColumnsToContents();
void resizeRowsToContents();
......
......@@ -36,7 +36,7 @@ class KateSQLConfigPage : public KTextEditor::ConfigPage
explicit KateSQLConfigPage( QWidget* parent = 0 );
virtual ~KateSQLConfigPage();
public slots:
public Q_SLOTS:
virtual void apply();
virtual void reset();
virtual void defaults();
......@@ -46,7 +46,7 @@ class KateSQLConfigPage : public KTextEditor::ConfigPage
QCheckBox *m_box;
OutputStyleWidget *m_outputStyleWidget;
signals:
Q_SIGNALS:
void settingsChanged();
};
......
......@@ -49,7 +49,7 @@ class KateSQLPlugin : public Kate::Plugin, public KTextEditor::ConfigPageInterfa
QString configPageFullName (uint number = 0) const;
KIcon configPageIcon (uint number = 0) const;
signals:
Q_SIGNALS:
void globalSettingsChanged();
};
......
......@@ -46,7 +46,7 @@ class KateSQLView : public Kate::PluginView, public Kate::XMLGUIClient
SchemaBrowserWidget *schemaBrowserWidget() const { return m_schemaBrowserWidget; }
public slots:
public Q_SLOTS:
void slotConnectionCreate();
void slotConnectionEdit();
void slotConnectionRemove();
......
......@@ -32,18 +32,18 @@ class OutputStyleWidget : public QTreeWidget
QTreeWidgetItem* addContext(const QString &key, const QString &name);
public slots:
public Q_SLOTS:
void readConfig();
void writeConfig();
protected slots:
protected Q_SLOTS:
void slotChanged();
void updatePreviews();
void readConfig(QTreeWidgetItem *item);
void writeConfig(QTreeWidgetItem *item);
signals:
Q_SIGNALS:
void changed();
};
......
......@@ -48,7 +48,7 @@ class SchemaWidget : public QTreeWidget
void buildViews(QTreeWidgetItem * viewsItem);
void buildFields(QTreeWidgetItem * tableItem);
public slots:
public Q_SLOTS:
void buildTree(const QString &connection);
void refresh();
......@@ -58,7 +58,7 @@ class SchemaWidget : public QTreeWidget
void generateDelete();
void generateStatement(QSqlDriver::StatementType type);
private slots:
private Q_SLOTS:
void slotCustomContextMenuRequested(const QPoint &pos);
void slotItemExpanded(QTreeWidgetItem *item);
......
......@@ -43,7 +43,7 @@ class SQLManager : public QObject
int storeCredentials(const Connection &conn);
int readCredentials(const QString &name, QString &password);
public slots:
public Q_SLOTS:
void removeConnection(const QString &name);
void reopenConnection(const QString &name);
void loadConnections(KConfigGroup *connectionsGroup);
......@@ -53,7 +53,7 @@ class SQLManager : public QObject
protected:
void saveConnection(KConfigGroup *connectionsGroup, const Connection &conn);
signals:
Q_SIGNALS:
void connectionCreated(const QString &name);
void connectionRemoved(const QString &name);
void connectionAboutToBeClosed(const QString &name);
......
......@@ -33,7 +33,7 @@ class TextOutputWidget : public QWidget
TextOutputWidget(QWidget *parent = 0);
~TextOutputWidget();
public slots:
public Q_SLOTS:
void showErrorMessage(const QString &message);
void showSuccessMessage(const QString &message);
......
......@@ -44,7 +44,7 @@ class KateKttsdPluginView : public Kate::PluginView, public Kate::XMLGUIClient
explicit KateKttsdPluginView(Kate::MainWindow *mw );
~KateKttsdPluginView();
public slots:
public Q_SLOTS:
void slotReadOut();
};
......
......@@ -35,7 +35,7 @@ class PluginKateOpenHeader : public Kate::Plugin
Kate::PluginView *createView (Kate::MainWindow *mainWindow);
public slots:
public Q_SLOTS:
void slotOpenHeader ();
void tryOpen( const KUrl& url, const QStringList& extensions );
};
......
......@@ -26,9 +26,8 @@ set(kateprojectplugin_PART_SRCS
add_library (kateprojectplugin MODULE ${kateprojectplugin_PART_SRCS})
target_link_libraries(kateprojectplugin ktexteditor
KF5::Parts
KF5::KDE4Support
KF5::NewStuff Qt5::Script KF5::SonnetCore KF5::Archive KF5::KCMUtils KF5::PrintUtils KF5::ItemViews KF5::ItemModels)
KF5::Parts KF5::I18n
KF5::NewStuff Qt5::Script KF5::SonnetCore KF5::Archive KF5::KCMUtils KF5::PrintUtils KF5::ItemViews KF5::ItemModels KF5::IconThemes)
########### install files ###############
install(TARGETS kateprojectplugin DESTINATION ${PLUGIN_INSTALL_DIR} )
......
......@@ -245,7 +245,7 @@ class KateProject : public QObject
bool isModified, KTextEditor::ModificationInterface::ModifiedOnDiskReason reason);
signals:
Q_SIGNALS:
/**
* Emitted on project map changes.
* This includes the name!
......
......@@ -98,14 +98,14 @@ class KateProjectPlugin : public KTextEditor::ApplicationPlugin
return m_document2Project.value (document);
}
signals:
Q_SIGNALS:
/**
* Signal that a new project got created.
* @param project new created project
*/
void projectCreated (KateProject *project);
public slots:
public Q_SLOTS:
/**
* New document got created, we need to update our connections
* @param document new created document
......
......@@ -28,12 +28,12 @@
#include <kaction.h>
#include <kactioncollection.h>
#include <klocale.h>
#include <kpluginfactory.h>
#include <kpluginloader.h>
#include <kaboutdata.h>
#include <kiconloader.h>
#include <KLocalizedString>
#include <KXMLGUIFactory>
#include <KIconLoader>
#include <QDialog>
#include <QHBoxLayout>
......
......@@ -84,7 +84,7 @@ class KateProjectPluginView : public QObject, public KXMLGUIClient
return m_mainWindow;
}
public slots:
public Q_SLOTS:
/**
* Create views for given project.
* Either gives existing ones or creates new one
......@@ -93,7 +93,7 @@ class KateProjectPluginView : public QObject, public KXMLGUIClient
*/
QPair<KateProjectView *,KateProjectInfoView *> viewForProject (KateProject *project);
private slots:
private Q_SLOTS:
/**
* New view got created, we need to update our connections
* @param view new created view
......@@ -133,7 +133,7 @@ class KateProjectPluginView : public QObject, public KXMLGUIClient
*/
void projectMapChanged ();
private slots:
private Q_SLOTS:
/**
* This slot is called whenever the active view changes in our main window.
*/
......
......@@ -12,8 +12,7 @@ qt5_wrap_ui (katesearchplugin_PART_SRCS search.ui results.ui)
add_library(katesearchplugin MODULE ${katesearchplugin_PART_SRCS})
target_link_libraries(katesearchplugin ktexteditor
KF5::Parts
KF5::KDE4Support
KF5::Parts KF5::I18n KF5::IconThemes
KF5::NewStuff Qt5::Script KF5::SonnetCore KF5::Archive KF5::KCMUtils KF5::PrintUtils KF5::ItemViews)
########### install files ###############
......
......@@ -20,8 +20,6 @@
#include "FolderFilesList.h"
#include <kmimetype.h>
#include <QDir>
#include <QFileInfo>
#include <QFileInfoList>
......@@ -89,7 +87,7 @@ void FolderFilesList::checkNextItem(const QFileInfo &item)
return;
}
if (item.isFile()) {
if (!m_binary && KMimeType::isBinaryData(item.absoluteFilePath())) {
if (!m_binary && false /* KMimeType::isBinaryData(item.absoluteFilePath()) FIXME KF5 */) {
return;
}
m_files << item.absoluteFilePath();
......
......@@ -42,7 +42,6 @@
#include <kcolorscheme.h>
#include <kiconloader.h>
#include <KIcon>
#include <KXMLGUIFactory>
#include <KConfigGroup>
......@@ -271,14 +270,14 @@ m_mainWindow (mainWin)
m_ui.resultTabWidget->tabBar()->setSelectionBehaviorOnRemove(QTabBar::SelectLeftTab);
KAcceleratorManager::setNoAccel(m_ui.resultTabWidget);
m_ui.displayOptions->setIcon(KIcon("arrow-down-double"));
m_ui.searchButton->setIcon(KIcon("edit-find"));
m_ui.stopButton->setIcon(KIcon("process-stop"));
m_ui.searchPlaceCombo->setItemIcon(0, KIcon("text-plain"));
m_ui.searchPlaceCombo->setItemIcon(1, KIcon("folder"));
m_ui.folderUpButton->setIcon(KIcon("go-up"));
m_ui.currentFolderButton->setIcon(KIcon("view-refresh"));
m_ui.newTabButton->setIcon(KIcon("tab-new"));
m_ui.displayOptions->setIcon(SmallIcon("arrow-down-double"));
m_ui.searchButton->setIcon(SmallIcon("edit-find"));
m_ui.stopButton->setIcon(SmallIcon("process-stop"));
m_ui.searchPlaceCombo->setItemIcon(0, SmallIcon("text-plain"));
m_ui.searchPlaceCombo->setItemIcon(1, SmallIcon("folder"));
m_ui.folderUpButton->setIcon(SmallIcon("go-up"));
m_ui.currentFolderButton->setIcon(SmallIcon("view-refresh"));
m_ui.newTabButton->setIcon(SmallIcon("tab-new"));
m_ui.filterCombo->setToolTip(i18n("Comma separated list of file types to search in. Example: \"*.cpp,*.h\"\n"));
m_ui.excludeCombo->setToolTip(i18n("Comma separated list of files and directories to exclude from the search. Example: \"build*\""));
......@@ -748,7 +747,7 @@ void KatePluginSearchView::addMatchMark(KTextEditor::Document* doc, int line, in
if (!iface) return;
iface->setMarkDescription(KTextEditor::MarkInterface::markType32, i18n("SearchHighLight"));
iface->setMarkPixmap(KTextEditor::MarkInterface::markType32,
KIcon().pixmap(0,0));
QIcon().pixmap(0,0));
iface->addMark(line, KTextEditor::MarkInterface::markType32);
connect(doc, SIGNAL(aboutToInvalidateMovingInterfaceContent(KTextEditor::Document*)),
......@@ -762,10 +761,10 @@ void KatePluginSearchView::matchFound(const QString &url, const QString &fName,
return;
}
QString pre = Qt::escape(lineContent.left(column));
QString match = Qt::escape(lineContent.mid(column, matchLen));
QString pre = lineContent.left(column).toHtmlEscaped();
QString match = lineContent.mid(column, matchLen).toHtmlEscaped();
match.replace('\n', "\\n");
QString post = Qt::escape(lineContent.mid(column + matchLen));
QString post = lineContent.mid(column + matchLen).toHtmlEscaped();
QStringList row;
row << i18n("Line: <b>%1</b>: %2", line+1, pre+"<b>"+match+"</b>"+post);
......@@ -1625,7 +1624,7 @@ void KatePluginSearchView::searchContextMenu(const QPoint& pos)
QMenu* menu = contextMenu->addMenu(i18n("Add..."));
if (!menu) return;
menu->setIcon(KIcon("list-add"));
menu->setIcon(SmallIcon("list-add"));
actionPointers << menuEntry(menu, "^", "", i18n("Beginning of line"));
actionPointers << menuEntry(menu, "$", "", i18n("End of line"));
......
......@@ -63,7 +63,7 @@ class KatePluginSymbolViewerConfigPage : public KTextEditor::ConfigPage
virtual void reset () { ; }
virtual void defaults () { ; }
signals:
Q_SIGNALS:
/**
* Ask the plugin to set initial values
*/
......@@ -93,7 +93,7 @@ class KatePluginSymbolViewerView : public Kate::PluginView, public Kate::XMLGUI
void parseSymbols(void);
public slots:
public Q_SLOTS:
void slotRefreshSymbol();
void slotChangeMode();
void slotEnableSorting();
......@@ -154,7 +154,7 @@ class KatePluginSymbolViewer : public Kate::Plugin, KTextEditor::ConfigPageInter
QPixmap configPagePixmap (uint, int) const { return 0L; }
KIcon configPageIcon (uint number = 0) const;
public slots:
public Q_SLOTS:
void applyConfig( KatePluginSymbolViewerConfigPage* p );
public:
......
......@@ -153,11 +153,11 @@ public:
void setHighlightMarks( const QMap<QString, QString>& marks );
QMap<QString, QString> highlightMarks() const;
public slots:
public Q_SLOTS:
void setCurrentTab( int button_id ); // does not emit signal
void removeHighlightMarks();
signals:
Q_SIGNALS:
/**
* This signal is emitted whenever the current activated tab changes.
*/
......@@ -180,7 +180,7 @@ signals:
*/
void highlightMarksChanged( KTinyTabBar* tabbar );
protected slots:
protected Q_SLOTS:
void tabButtonActivated( KTinyTabButton* tabButton );
void tabButtonHighlightChanged( KTinyTabButton* tabButton );
void tabButtonCloseAllRequest();
......
......@@ -49,7 +49,7 @@ public:
KTinyTabBarConfigPage* configPage();
protected slots:
protected Q_SLOTS:
void configChanged();
private:
......
......@@ -106,11 +106,11 @@ public:
QColor modifiedTabsColor() const;
signals:
Q_SIGNALS:
void changed();
void removeHighlightMarks();
protected slots:
protected Q_SLOTS:
void minimumTabWidthChanged(int value);
void maximumTabWidthChanged(int value);
void fixedTabHeightChanged(int value);
......
......@@ -171,7 +171,7 @@ public:
void setModified( bool modified );
bool isModified() const;
signals:
Q_SIGNALS:
/**
* Emitted whenever the button changes state from deactivated to activated.
* @param tabbutton the pressed button (this)
......@@ -203,7 +203,7 @@ signals:
*/
void closeAllTabsRequest();
protected slots:
protected Q_SLOTS:
void buttonClicked();
protected:
......
......@@ -59,7 +59,7 @@ public:
void readSessionConfig (KConfigBase* config, const QString& groupPrefix);
void writeSessionConfig (KConfigBase* config, const QString& groupPrefix);
public slots:
public Q_SLOTS:
void currentTabChanged( int button_id );
void closeTabRequest( int button_id );
void slotDocumentCreated( KTextEditor::Document* document );
......@@ -89,7 +89,7 @@ class KatePluginTabBarExtension : public Kate::Plugin
void readSessionConfig (KConfigBase* config, const QString& groupPrefix);
void writeSessionConfig (KConfigBase* config, const QString& groupPrefix);
protected slots:
protected Q_SLOTS:
void tabbarSettingsChanged( KTinyTabBar* tabbar );
void tabbarHighlightMarksChanged( KTinyTabBar* tabbar );
......
......@@ -44,7 +44,7 @@ public:
explicit TabBarPluginView(Kate::MainWindow* mainwindow);
virtual ~TabBarPluginView();
public slots:
public Q_SLOTS:
void slotDocumentCreated(KTextEditor::Document* doc);
void slotTabChanged(int);
void slotDocumentDeleted(KTextEditor::Document*);
......
......@@ -57,7 +57,7 @@ class PluginKateTextFilter : public Kate::Plugin, public KTextEditor::Command
QStringList completionList;
bool copyResult;
bool mergeOutput;
public slots:
public Q_SLOTS:
void slotEditFilter ();
void slotFilterReceivedStdout();
void slotFilterReceivedStderr();
......
......@@ -51,7 +51,7 @@ public:
Kate::MainWindow *win;
QWidget *dock;
public slots:
public Q_SLOTS:
bool slotValidate();
void slotClicked(QTreeWidgetItem *item, int column);
void slotProcExited(int exitCode, QProcess::ExitStatus exitStatus);
......
......@@ -83,7 +83,7 @@ class PluginKateXMLToolsCompletionModel
, const KTextEditor::Cursor &position
);
public slots:
public Q_SLOTS:
void getDTD();
......@@ -167,7 +167,7 @@ class InsertElement : public KDialog
InsertElement( QWidget *parent, const char *name );
~InsertElement();
QString showDialog( QStringList &completions );
private slots:
private Q_SLOTS:
void slotHistoryTextChanged( const QString& );
};
......
......@@ -41,7 +41,7 @@ class ExporterPluginView : public QObject, public KXMLGUIClient
///TODO: maybe make this scriptable for additional exporters?
void exportData(const bool useSelction, QTextStream& output);