Commit f051e7fe authored by Christoph Cullmann's avatar Christoph Cullmann

initial Kate application port, still a lot work

parent ec28f3e2
...@@ -83,7 +83,7 @@ ecm_optional_add_subdirectory (part) ...@@ -83,7 +83,7 @@ ecm_optional_add_subdirectory (part)
ecm_optional_add_subdirectory (kwrite) ecm_optional_add_subdirectory (kwrite)
# kate application # kate application
#macro_optional_add_subdirectory (kate) ecm_optional_add_subdirectory (kate)
# addons, e.g. ktexteditor plugins, kate plugins, plasma applets, ... # addons, e.g. ktexteditor plugins, kate plugins, plasma applets, ...
#macro_optional_add_subdirectory (addons) #macro_optional_add_subdirectory (addons)
......
...@@ -6,7 +6,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces) ...@@ -6,7 +6,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces)
add_subdirectory( interfaces/kate ) add_subdirectory( interfaces/kate )
add_subdirectory( app ) add_subdirectory( app )
add_subdirectory( filetree ) #add_subdirectory( filetree )
add_subdirectory( data ) add_subdirectory( data )
......
...@@ -27,47 +27,23 @@ set(kateinterfaces_LIB_SRCS kateappadaptor.cpp ...@@ -27,47 +27,23 @@ set(kateinterfaces_LIB_SRCS kateappadaptor.cpp
kde4_add_library(kateinterfaces SHARED ${kateinterfaces_LIB_SRCS}) add_library (kateinterfaces SHARED ${kateinterfaces_LIB_SRCS})
# some stuff to have it compile for KDE 4.4
if (NOT KDE_NO_DEPRECATED)
set (KDE_4_4_LIBS_NEEDED ${KDE4_KUTILS_LIBS})
endif()
target_link_libraries(kateinterfaces ${KDE_4_4_LIBS_NEEDED} ${QT_QTXML_LIBRARY} ${KDE4_KTEXTEDITOR_LIBS} ${KDE4_KPARTS_LIBS} ${KACTIVITIES_LIBRARY} )
target_link_libraries(kateinterfaces LINK_INTERFACE_LIBRARIES "${KDE4_KPARTS_LIBS}" )
target_link_libraries (kateinterfaces ktexteditor
KF5::KParts
KF5::KDE4Support
KF5::KNewStuff Qt5::Script KF5::SonnetCore KF5::KArchive KF5::KCMUtils KF5::KPrintUtils KF5::ItemViews
)
set_target_properties(kateinterfaces PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION}) set_target_properties(kateinterfaces PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
install(TARGETS kateinterfaces ${INSTALL_TARGETS_DEFAULT_ARGS} ) install(TARGETS kateinterfaces ${INSTALL_TARGETS_DEFAULT_ARGS} )
#
# Kate Application
#
kf5_add_kdeinit_executable(kate katemain.cpp)
target_link_libraries(kdeinit_kate ktexteditor kateinterfaces)
########### next target ############### install(TARGETS kate ${INSTALL_TARGETS_DEFAULT_ARGS})
install(TARGETS kdeinit_kate ${INSTALL_TARGETS_DEFAULT_ARGS})
set(kate_KDEINIT_SRCS katemain.cpp)
if (WIN32)
configure_file(${KDE4_MODULE_DIR}/kde4init_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/kate_dummy.cpp)
list(APPEND kate_KDEINIT_SRCS ${CMAKE_CURRENT_BINARY_DIR}/kate_dummy.cpp)
#kde4_add_app_icon(kate_KDEINIT_SRCS "${KDE4_INSTALL_DIR}/share/icons/oxygen/*/apps/kate.png")
kde4_add_app_icon(kate_KDEINIT_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../pics/hi*-app-kate.png")
kde4_add_executable(kate ${kate_KDEINIT_SRCS} )
target_link_libraries( kate ${QT_QTMAIN_LIBRARY} ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBS} kateinterfaces )
else (WIN32)
kde4_add_kdeinit_executable( kate ${kate_KDEINIT_SRCS})
target_link_libraries(kdeinit_kate ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBS} kateinterfaces )
install(TARGETS kdeinit_kate ${INSTALL_TARGETS_DEFAULT_ARGS} )
target_link_libraries( kate kdeinit_kate )
endif (WIN32)
install(TARGETS kate ${INSTALL_TARGETS_DEFAULT_ARGS})
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <kdebug.h> #include <kdebug.h>
#include <KMessageBox> #include <KMessageBox>
#include <KLocale> #include <KLocale>
#include <KGlobal>
#include <KStartupInfo> #include <KStartupInfo>
#include <QFileInfo> #include <QFileInfo>
...@@ -46,10 +47,10 @@ ...@@ -46,10 +47,10 @@
#include <unistd.h> #include <unistd.h>
#include "kateappadaptor.h" #include "kateappadaptor.h"
KateApp::KateApp (KCmdLineArgs *args) KateApp::KateApp(int & argc, char ** argv)
: KApplication () : QApplication (argc, argv)
, m_shouldExit(false) , m_shouldExit(false)
, m_args (args) , m_args (0)
{ {
setQuitOnLastWindowClosed (false); setQuitOnLastWindowClosed (false);
...@@ -99,7 +100,7 @@ KateApp::~KateApp () ...@@ -99,7 +100,7 @@ KateApp::~KateApp ()
KateApp *KateApp::self () KateApp *KateApp::self ()
{ {
return static_cast<KateApp *>(kapp); return static_cast<KateApp *>(QApplication::instance());
} }
Kate::Application *KateApp::application () Kate::Application *KateApp::application ()
...@@ -121,7 +122,7 @@ void KateApp::initKate () ...@@ -121,7 +122,7 @@ void KateApp::initKate ()
{ {
kDebug() << "Setting KATE_PID: '" << getpid() << "'"; kDebug() << "Setting KATE_PID: '" << getpid() << "'";
::setenv( "KATE_PID", QString("%1").arg(getpid()).toLatin1(), 1 ); ::setenv( "KATE_PID", QString("%1").arg(getpid()).toLatin1().constData(), 1 );
// handle restore different // handle restore different
if (isSessionRestored()) if (isSessionRestored())
...@@ -146,6 +147,11 @@ void KateApp::initKate () ...@@ -146,6 +147,11 @@ void KateApp::initKate ()
void KateApp::restoreKate () void KateApp::restoreKate ()
{ {
#ifdef FIXME
/// FIXME KF5
// activate again correct session!!! // activate again correct session!!!
QString lastSession (sessionConfig()->group("General").readEntry ("Last Session", QString())); QString lastSession (sessionConfig()->group("General").readEntry ("Last Session", QString()));
sessionManager()->activateSession (KateSession::Ptr(new KateSession (sessionManager(), lastSession)), false, false, false); sessionManager()->activateSession (KateSession::Ptr(new KateSession (sessionManager(), lastSession)), false, false, false);
...@@ -159,7 +165,8 @@ void KateApp::restoreKate () ...@@ -159,7 +165,8 @@ void KateApp::restoreKate ()
// restore all windows ;) // restore all windows ;)
for (int n = 1; KMainWindow::canBeRestored(n); n++) for (int n = 1; KMainWindow::canBeRestored(n); n++)
newMainWindow(sessionConfig(), QString ("%1").arg(n)); newMainWindow(sessionConfig(), QString ("%1").arg(n));
#endif
// oh, no mainwindow, create one, should not happen, but make sure ;) // oh, no mainwindow, create one, should not happen, but make sure ;)
if (mainWindows() == 0) if (mainWindows() == 0)
newMainWindow (); newMainWindow ();
...@@ -167,6 +174,10 @@ void KateApp::restoreKate () ...@@ -167,6 +174,10 @@ void KateApp::restoreKate ()
bool KateApp::startupKate () bool KateApp::startupKate ()
{ {
#if FIXME
// FIXME KF5
// user specified session to open // user specified session to open
if (m_args->isSet ("startanon")) if (m_args->isSet ("startanon"))
{ {
...@@ -194,6 +205,8 @@ bool KateApp::startupKate () ...@@ -194,6 +205,8 @@ bool KateApp::startupKate ()
sessionManager()->activateSession( KateSession::Ptr(new KateSession (sessionManager(), QString())), false, false ); sessionManager()->activateSession( KateSession::Ptr(new KateSession (sessionManager(), QString())), false, false );
} }
#endif
// oh, no mainwindow, create one, should not happen, but make sure ;) // oh, no mainwindow, create one, should not happen, but make sure ;)
if (mainWindows() == 0) if (mainWindows() == 0)
newMainWindow (); newMainWindow ();
...@@ -202,6 +215,12 @@ bool KateApp::startupKate () ...@@ -202,6 +215,12 @@ bool KateApp::startupKate ()
#ifdef Q_WS_X11 #ifdef Q_WS_X11
KStartupInfo::setNewStartupId( activeMainWindow(), startupId()); KStartupInfo::setNewStartupId( activeMainWindow(), startupId());
#endif #endif
#if FIXME
// FIXME KF5
QTextCodec *codec = m_args->isSet("encoding") ? QTextCodec::codecForName(m_args->getOption("encoding").toUtf8()) : 0; QTextCodec *codec = m_args->isSet("encoding") ? QTextCodec::codecForName(m_args->getOption("encoding").toUtf8()) : 0;
bool tempfileSet = KCmdLineArgs::isTempFileSet(); bool tempfileSet = KCmdLineArgs::isTempFileSet();
...@@ -273,6 +292,8 @@ bool KateApp::startupKate () ...@@ -273,6 +292,8 @@ bool KateApp::startupKate ()
if (nav && activeMainWindow()->viewManager()->activeView ()) if (nav && activeMainWindow()->viewManager()->activeView ())
activeMainWindow()->viewManager()->activeView ()->setCursorPosition (KTextEditor::Cursor (line, column)); activeMainWindow()->viewManager()->activeView ()->setCursorPosition (KTextEditor::Cursor (line, column));
#endif
// show the nice tips // show the nice tips
KTipDialog::showTip(activeMainWindow()); KTipDialog::showTip(activeMainWindow());
......
...@@ -52,7 +52,7 @@ class KCmdLineArgs; ...@@ -52,7 +52,7 @@ class KCmdLineArgs;
* Kate Application * Kate Application
* This class represents the core kate application object * This class represents the core kate application object
*/ */
class KATEINTERFACES_EXPORT KateApp : public KApplication class KATEINTERFACES_EXPORT KateApp : public QApplication
{ {
Q_OBJECT Q_OBJECT
...@@ -62,9 +62,8 @@ class KATEINTERFACES_EXPORT KateApp : public KApplication ...@@ -62,9 +62,8 @@ class KATEINTERFACES_EXPORT KateApp : public KApplication
public: public:
/** /**
* application constructor * application constructor
* @param args parsed command line args
*/ */
KateApp (KCmdLineArgs *args); KateApp (int & argc, char ** argv);
/** /**
* application destructor * application destructor
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <QDir> #include <QDir>
#include <QTimer> #include <QTimer>
#include <KLocale> #include <KLocale>
#include <klocalizedstring.h>
#include "kateapp.h" #include "kateapp.h"
#include "kateappcommands.h" #include "kateappcommands.h"
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "katesession.h" #include "katesession.h"
#include <KTextEditor/ConfigPage> #include <KTextEditor/ConfigPage>
#include <KTextEditor/EditorChooser>
#include <kdebug.h> #include <kdebug.h>
#include <KGlobal> #include <KGlobal>
...@@ -40,6 +39,7 @@ ...@@ -40,6 +39,7 @@
#include <KConfig> #include <KConfig>
#include <kstandardaction.h> #include <kstandardaction.h>
#include <KVBox> #include <KVBox>
#include <klocalizedstring.h>
#include <QCheckBox> #include <QCheckBox>
#include <QLabel> #include <QLabel>
...@@ -56,16 +56,16 @@ KateConfigDialog::KateConfigDialog ( KateMainWindow *parent, KTextEditor::View * ...@@ -56,16 +56,16 @@ KateConfigDialog::KateConfigDialog ( KateMainWindow *parent, KTextEditor::View *
, m_view( view ) , m_view( view )
{ {
setFaceType( Tree ); setFaceType( Tree );
setCaption( i18n("Configure") ); // FIXME KF5 setCaption( i18n("Configure") );
setButtons( Ok | Apply | Cancel | Help ); // FIXME KF5 setButtons( Ok | Apply | Cancel | Help );
setDefaultButton( Ok ); // FIXME KF5 setDefaultButton( Ok );
setObjectName( "configdialog" ); setObjectName( "configdialog" );
setHelp( QString(), KGlobal::mainComponent().componentName() ); // FIXME KF5 setHelp( QString(), KGlobal::mainComponent().componentName() );
KSharedConfig::Ptr config = KGlobal::config(); KSharedConfig::Ptr config = KGlobal::config();
KConfigGroup cgGeneral = KConfigGroup( config, "General" ); KConfigGroup cgGeneral = KConfigGroup( config, "General" );
enableButton( Apply, false ); // FIXME KF5 enableButton( Apply, false );
KPageWidgetItem *applicationItem = addPage( new QWidget, i18n("Application") ); KPageWidgetItem *applicationItem = addPage( new QWidget, i18n("Application") );
applicationItem->setIcon( KIcon( "preferences-other" ) ); applicationItem->setIcon( KIcon( "preferences-other" ) );
...@@ -368,13 +368,13 @@ void KateConfigDialog::slotApply() ...@@ -368,13 +368,13 @@ void KateConfigDialog::slotApply()
config->sync(); config->sync();
m_dataChanged = false; m_dataChanged = false;
enableButton( Apply, false ); // FIXME KF5 enableButton( Apply, false );
} }
void KateConfigDialog::slotChanged() void KateConfigDialog::slotChanged()
{ {
m_dataChanged = true; m_dataChanged = true;
enableButton( Apply, true ); // FIXME KF5 enableButton( Apply, true );
m_daysMetaInfos->setSuffix(i18ncp("The suffix of 'Delete unused meta-information after'", " day", " days", m_daysMetaInfos->value())); m_daysMetaInfos->setSuffix(i18ncp("The suffix of 'Delete unused meta-information after'", " day", " days", m_daysMetaInfos->value()));
} }
......
...@@ -26,7 +26,9 @@ ...@@ -26,7 +26,9 @@
#include <kate/plugin.h> #include <kate/plugin.h>
#include <kate/pluginconfigpageinterface.h> #include <kate/pluginconfigpageinterface.h>
#include <KTextEditor/EditorChooser> #include <KTextEditor/Editor>
#include <KTextEditor/Document>
#include <KTextEditor/View>
#include <KPageDialog> #include <KPageDialog>
#include <QList> #include <QList>
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "katepluginmanager.h" #include "katepluginmanager.h"
#include "kateconfigdialog.h" #include "kateconfigdialog.h"
#include <klocalizedstring.h>
class KatePluginListItem : public QTreeWidgetItem class KatePluginListItem : public QTreeWidgetItem
{ {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <KTextEditor/View> #include <KTextEditor/View>
#include <KTextEditor/SessionConfigInterface> #include <KTextEditor/SessionConfigInterface>
#include <KTextEditor/EditorChooser> #include <KTextEditor/Editor>
#include <KTextEditor/ContainerInterface> #include <KTextEditor/ContainerInterface>
#include <KParts/Factory> #include <KParts/Factory>
...@@ -44,10 +44,12 @@ ...@@ -44,10 +44,12 @@
#include <KIconLoader> #include <KIconLoader>
#include <KProgressDialog> #include <KProgressDialog>
#include <KColorScheme> #include <KColorScheme>
#include <klocalizedstring.h>
#include <QDateTime> #include <QDateTime>
#include <QTextCodec> #include <QTextCodec>
#include <QByteArray> #include <QByteArray>
#include <QtCore/QCryptographicHash>
#include <QHash> #include <QHash>
#include <QListView> #include <QListView>
#include <QTimer> #include <QTimer>
...@@ -60,7 +62,7 @@ KateDocManager::KateDocManager (QObject *parent) ...@@ -60,7 +62,7 @@ KateDocManager::KateDocManager (QObject *parent)
, m_suppressOpeningErrorDialogs (false) , m_suppressOpeningErrorDialogs (false)
{ {
// Constructed the beloved editor ;) // Constructed the beloved editor ;)
m_editor = KTextEditor::EditorChooser::editor(); m_editor = KTextEditor::editor();
if ( !m_editor ) if ( !m_editor )
{ {
...@@ -81,7 +83,7 @@ KateDocManager::KateDocManager (QObject *parent) ...@@ -81,7 +83,7 @@ KateDocManager::KateDocManager (QObject *parent)
m_documentManager = new Kate::DocumentManager (this); m_documentManager = new Kate::DocumentManager (this);
m_metaInfos = new KConfig("metainfos", KConfig::NoGlobals, "appdata" ); m_metaInfos = new KConfig("metainfos", KConfig::NoGlobals, QStandardPaths::DataLocation );
createDoc (); createDoc ();
} }
...@@ -454,7 +456,7 @@ bool KateDocManager::queryCloseDocuments(KateMainWindow *w) ...@@ -454,7 +456,7 @@ bool KateDocManager::queryCloseDocuments(KateMainWindow *w)
if (msgres == KMessageBox::Yes) if (msgres == KMessageBox::Yes)
{ {
KEncodingFileDialog::Result r = KEncodingFileDialog::getSaveUrlAndEncoding( doc->encoding(), QString(), QString(), w, i18n("Save As")); KEncodingFileDialog::Result r = KEncodingFileDialog::getSaveUrlAndEncoding( doc->encoding(), QUrl(), QString(), w, i18n("Save As"));
doc->setEncoding( r.encoding ); doc->setEncoding( r.encoding );
...@@ -623,7 +625,7 @@ bool KateDocManager::loadMetaInfos(KTextEditor::Document *doc, const KUrl &url) ...@@ -623,7 +625,7 @@ bool KateDocManager::loadMetaInfos(KTextEditor::Document *doc, const KUrl &url)
KConfigGroup urlGroup( m_metaInfos, url.prettyUrl() ); KConfigGroup urlGroup( m_metaInfos, url.prettyUrl() );
const QString old_md5 = urlGroup.readEntry("MD5"); const QString old_md5 = urlGroup.readEntry("MD5");
if ((const char *)md5 == old_md5) if (QString (md5) == old_md5)
{ {
if (KTextEditor::ParameterizedSessionConfigInterface *iface = if (KTextEditor::ParameterizedSessionConfigInterface *iface =
qobject_cast<KTextEditor::ParameterizedSessionConfigInterface *>(doc)) qobject_cast<KTextEditor::ParameterizedSessionConfigInterface *>(doc))
...@@ -667,7 +669,7 @@ void KateDocManager::saveMetaInfos(const QList<KTextEditor::Document *> &documen ...@@ -667,7 +669,7 @@ void KateDocManager::saveMetaInfos(const QList<KTextEditor::Document *> &documen
if (computeUrlMD5(doc->url(), md5)) if (computeUrlMD5(doc->url(), md5))
{ {
KConfigGroup urlGroup( m_metaInfos, doc->url().prettyUrl() ); KConfigGroup urlGroup( m_metaInfos, doc->url().toString() );
if (KTextEditor::SessionConfigInterface *iface = qobject_cast<KTextEditor::SessionConfigInterface *>(doc)) if (KTextEditor::SessionConfigInterface *iface = qobject_cast<KTextEditor::SessionConfigInterface *>(doc))
iface->writeSessionConfig(urlGroup); iface->writeSessionConfig(urlGroup);
...@@ -688,12 +690,10 @@ bool KateDocManager::computeUrlMD5(const KUrl &url, QByteArray &result) ...@@ -688,12 +690,10 @@ bool KateDocManager::computeUrlMD5(const KUrl &url, QByteArray &result)
if (f.exists() && f.open(QIODevice::ReadOnly)) if (f.exists() && f.open(QIODevice::ReadOnly))
{ {
KMD5 md5; QCryptographicHash crypto(QCryptographicHash::Md5);
while(!f.atEnd())
if (!md5.update(f)) crypto.addData (f.read(256 * 1024));
return false; result = crypto.result();
md5.hexDigest(result);
f.close(); f.close();
} }
else else
......
...@@ -78,68 +78,74 @@ extern "C" KDE_EXPORT int kdemain( int argc, char **argv ) ...@@ -78,68 +78,74 @@ extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
// here we go, construct the Kate version // here we go, construct the Kate version
QByteArray kateVersion = KateApp::kateVersion().toLatin1(); QByteArray kateVersion = KateApp::kateVersion().toLatin1();
KAboutData aboutData ("kate", 0, ki18n("Kate"), kateVersion, KAboutData aboutData ("kate", 0, i18n("Kate"), kateVersion,
ki18n( "Kate - Advanced Text Editor" ), KAboutData::License_LGPL_V2, i18n( "Kate - Advanced Text Editor" ), KAboutData::License_LGPL_V2,
ki18n( "(c) 2000-2013 The Kate Authors" ), KLocalizedString(), "http://www.kate-editor.org"); i18n( "(c) 2000-2013 The Kate Authors" ), QString(), "http://www.kate-editor.org");
aboutData.setOrganizationDomain("kde.org"); aboutData.setOrganizationDomain("kde.org");
aboutData.addAuthor (ki18n("Christoph Cullmann"), ki18n("Maintainer"), "cullmann@kde.org", "http://www.cullmann.io"); aboutData.addAuthor (i18n("Christoph Cullmann"), i18n("Maintainer"), "cullmann@kde.org", "http://www.cullmann.io");
aboutData.addAuthor (ki18n("Anders Lund"), ki18n("Core Developer"), "anders@alweb.dk", "http://www.alweb.dk"); aboutData.addAuthor (i18n("Anders Lund"), i18n("Core Developer"), "anders@alweb.dk", "http://www.alweb.dk");
aboutData.addAuthor (ki18n("Joseph Wenninger"), ki18n("Core Developer"), "jowenn@kde.org", "http://stud3.tuwien.ac.at/~e9925371"); aboutData.addAuthor (i18n("Joseph Wenninger"), i18n("Core Developer"), "jowenn@kde.org", "http://stud3.tuwien.ac.at/~e9925371");
aboutData.addAuthor (ki18n("Hamish Rodda"), ki18n("Core Developer"), "rodda@kde.org"); aboutData.addAuthor (i18n("Hamish Rodda"), i18n("Core Developer"), "rodda@kde.org");
aboutData.addAuthor (ki18n("Dominik Haumann"), ki18n("Developer & Highlight wizard"), "dhdev@gmx.de"); aboutData.addAuthor (i18n("Dominik Haumann"), i18n("Developer & Highlight wizard"), "dhdev@gmx.de");
aboutData.addAuthor (ki18n("Waldo Bastian"), ki18n( "The cool buffersystem" ), "bastian@kde.org" ); aboutData.addAuthor (i18n("Waldo Bastian"), i18n( "The cool buffersystem" ), "bastian@kde.org" );
aboutData.addAuthor (ki18n("Charles Samuels"), ki18n("The Editing Commands"), "charles@kde.org"); aboutData.addAuthor (i18n("Charles Samuels"), i18n("The Editing Commands"), "charles@kde.org");
aboutData.addAuthor (ki18n("Matt Newell"), ki18n("Testing, ..."), "newellm@proaxis.com"); aboutData.addAuthor (i18n("Matt Newell"), i18n("Testing, ..."), "newellm@proaxis.com");
aboutData.addAuthor (ki18n("Michael Bartl"), ki18n("Former Core Developer"), "michael.bartl1@chello.at"); aboutData.addAuthor (i18n("Michael Bartl"), i18n("Former Core Developer"), "michael.bartl1@chello.at");
aboutData.addAuthor (ki18n("Michael McCallum"), ki18n("Core Developer"), "gholam@xtra.co.nz"); aboutData.addAuthor (i18n("Michael McCallum"), i18n("Core Developer"), "gholam@xtra.co.nz");
aboutData.addAuthor (ki18n("Jochen Wilhemly"), ki18n( "KWrite Author" ), "digisnap@cs.tu-berlin.de" ); aboutData.addAuthor (i18n("Jochen Wilhemly"), i18n( "KWrite Author" ), "digisnap@cs.tu-berlin.de" );
aboutData.addAuthor (ki18n("Michael Koch"), ki18n("KWrite port to KParts"), "koch@kde.org"); aboutData.addAuthor (i18n("Michael Koch"), i18n("KWrite port to KParts"), "koch@kde.org");
aboutData.addAuthor (ki18n("Christian Gebauer"), KLocalizedString(), "gebauer@kde.org" ); aboutData.addAuthor (i18n("Christian Gebauer"), QString(), "gebauer@kde.org" );
aboutData.addAuthor (ki18n("Simon Hausmann"), KLocalizedString(), "hausmann@kde.org" ); aboutData.addAuthor (i18n("Simon Hausmann"), QString(), "hausmann@kde.org" );
aboutData.addAuthor (ki18n("Glen Parker"), ki18n("KWrite Undo History, Kspell integration"), "glenebob@nwlink.com"); aboutData.addAuthor (i18n("Glen Parker"), i18n("KWrite Undo History, Kspell integration"), "glenebob@nwlink.com");
aboutData.addAuthor (ki18n("Scott Manson"), ki18n("KWrite XML Syntax highlighting support"), "sdmanson@alltel.net"); aboutData.addAuthor (i18n("Scott Manson"), i18n("KWrite XML Syntax highlighting support"), "sdmanson@alltel.net");
aboutData.addAuthor (ki18n("John Firebaugh"), ki18n("Patches and more"), "jfirebaugh@kde.org"); aboutData.addAuthor (i18n("John Firebaugh"), i18n("Patches and more"), "jfirebaugh@kde.org");
aboutData.addAuthor (ki18n("Pablo Martín"), ki18n("Python Plugin Developer"), "goinnn@gmail.com", "http://github.com/goinnn/"); aboutData.addAuthor (i18n("Pablo Martín"), i18n("Python Plugin Developer"), "goinnn@gmail.com", "http://github.com/goinnn/");
aboutData.addAuthor (ki18n("Gerald Senarclens de Grancy"), ki18n("QA and Scripting"), "oss@senarclens.eu", "http://find-santa.eu/"); aboutData.addAuthor (i18n("Gerald Senarclens de Grancy"), i18n("QA and Scripting"), "oss@senarclens.eu", "http://find-santa.eu/");
aboutData.addCredit (ki18n("Matteo Merli"), ki18n("Highlighting for RPM Spec-Files, Perl, Diff and more"), "merlim@libero.it"); aboutData.addCredit (i18n("Matteo Merli"), i18n("Highlighting for RPM Spec-Files, Perl, Diff and more"), "merlim@libero.it");
aboutData.addCredit (ki18n("Rocky Scaletta"), ki18n("Highlighting for VHDL"), "rocky@purdue.edu"); aboutData.addCredit (i18n("Rocky Scaletta"), i18n("Highlighting for VHDL"), "rocky@purdue.edu");
aboutData.addCredit (ki18n("Yury Lebedev"), ki18n("Highlighting for SQL")); aboutData.addCredit (i18n("Yury Lebedev"), i18n("Highlighting for SQL"));
aboutData.addCredit (ki18n("Chris Ross"), ki18n("Highlighting for Ferite")); aboutData.addCredit (i18n("Chris Ross"), i18n("Highlighting for Ferite"));
aboutData.addCredit (ki18n("Nick Roux"), ki18n("Highlighting for ILERPG")); aboutData.addCredit (i18n("Nick Roux"), i18n("Highlighting for ILERPG"));
aboutData.addCredit (ki18n("Carsten Niehaus"), ki18n("Highlighting for LaTeX")); aboutData.addCredit (i18n("Carsten Niehaus"), i18n("Highlighting for LaTeX"));
aboutData.addCredit (ki18n("Per Wigren"), ki18n("Highlighting for Makefiles, Python")); aboutData.addCredit (i18n("Per Wigren"), i18n("Highlighting for Makefiles, Python"));
aboutData.addCredit (ki18n("Jan Fritz"), ki18n("Highlighting for Python")); aboutData.addCredit (i18n("Jan Fritz"), i18n("Highlighting for Python"));
aboutData.addCredit (ki18n("Daniel Naber")); aboutData.addCredit (i18n("Daniel Naber"));
aboutData.addCredit (ki18n("Roland Pabel"), ki18n("Highlighting for Scheme")); aboutData.addCredit (i18n("Roland Pabel"), i18n("Highlighting for Scheme"));
aboutData.addCredit (ki18n("Cristi Dumitrescu"), ki18n("PHP Keyword/Datatype list")); aboutData.addCredit (i18n("Cristi Dumitrescu"), i18n("PHP Keyword/Datatype list"));
aboutData.addCredit (ki18n("Carsten Pfeiffer"), ki18n("Very nice help")); aboutData.addCredit (i18n("Carsten Pfeiffer"), i18n("Very nice help"));
aboutData.addCredit (ki18n("All people who have contributed and I have forgotten to mention")); aboutData.addCredit (i18n("All people who have contributed and I have forgotten to mention"));
#ifdef TODO
// FIXME KF5
// command line args init and co // command line args init and co
KCmdLineArgs::init (argc, argv, &aboutData); KCmdLineArgs::init (argc, argv, &aboutData);
KCmdLineOptions options; KCmdLineOptions options;
options.add("s"); options.add("s");
options.add("start <name>", ki18n("Start Kate with a given session")); options.add("start <name>", i18n("Start Kate with a given session"));
options.add("startanon", ki18n("Start Kate with a new anonymous session, implies '-n'")); options.add("startanon", i18n("Start Kate with a new anonymous session, implies '-n'"));
options.add("n"); options.add("n");
options.add("new", ki18n("Force start of a new kate instance (is ignored if start is used and another kate instance already has the given session opened), forced if no parameters and no URLs are given at all")); options.add("new", i18n("Force start of a new kate instance (is ignored if start is used and another kate instance already has the given session opened), forced if no parameters and no URLs are given at all"));
options.add("b"); options.add("b");
options.add("block", ki18n("If using an already running kate instance, block until it exits, if URLs given to open")); options.add("block", i18n("If using an already running kate instance, block until it exits, if URLs given to open"));
options.add("p"); options.add("p");
options.add("pid <pid>", ki18n("Only try to reuse kate instance with this pid (is ignored if start is used and another kate instance already has the given session opened)")); options.add("pid <pid>", i18n("Only try to reuse kate instance with this pid (is ignored if start is used and another kate instance already has the given session opened)"));
options.add("e"); options.add("e");
options.add("encoding <name>", ki18n("Set encoding for the file to open")); options.add("encoding <name>", i18n("Set encoding for the file to open"));
options.add("l"); options.add("l");
options.add("line <line>", ki18n("Navigate to this line")); options.add("line <line>", i18n("Navigate to this line"));
options.add("c"); options.add("c");
options.add("column <column>", ki18n("Navigate to this column")); options.add("column <column>", i18n("Navigate to this column"));
options.add("i"); options.add("i");
options.add("stdin", ki18n("Read the contents of stdin")); options.add("stdin", i18n("Read the contents of stdin"));
options.add("u"); options.add("u");
options.add("use", ki18n("Reuse existing Kate instance; default, only for compatibility")); options.add("use", i18n("Reuse existing Kate instance; default, only for compatibility"));
options.add("+[URL]", ki18n("Document to open")); options.add("+[URL]", i18n("Document to open"));
KCmdLineArgs::addCmdLineOptions (options); KCmdLineArgs::addCmdLineOptions (options);
KCmdLineArgs::addTempFileOption(); KCmdLineArgs::addTempFileOption();
...@@ -371,9 +377,10 @@ extern "C" KDE_EXPORT int kdemain( int argc, char **argv ) ...@@ -371,9 +377,10 @@ extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
// this will wait until exiting is emitted by the used instance, if wanted... // this will wait until exiting is emitted by the used instance, if wanted...
return needToBlock ? app.exec () : 0; return needToBlock ? app.exec () : 0;
} }
#endif
// construct the real kate app object ;) // construct the real kate app object ;)
KateApp app (args); KateApp app (argc, argv);
if (app.shouldExit()) return 0; if (app.shouldExit()) return 0;
// execute ourself ;) // execute ourself ;)
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
#include <KAboutData> #include <KAboutData>