From 6392f5a9dfce2bf83617d49bb7f332181ec6004e Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 25 May 2014 15:37:31 +0900 Subject: Revert "Finish renaming tdevelop components" This reverts commit 722ce1efbac31c61b1d4b13f7e075c9f311e3e73. --- parts/appwizard/CMakeLists.txt | 10 +- parts/appwizard/Makefile.am | 20 +- parts/appwizard/appwizarddlg.cpp | 42 +- parts/appwizard/appwizarddlg.h | 14 +- parts/appwizard/appwizardfactory.cpp | 18 +- parts/appwizard/appwizardfactory.h | 8 +- parts/appwizard/appwizardpart.cpp | 14 +- parts/appwizard/appwizardpart.h | 4 +- parts/appwizard/common/CMakeLists.txt | 16 +- parts/appwizard/common/Makefile.am | 12 +- parts/appwizard/common/admin.kdevtemplate | 5 + parts/appwizard/common/admin.tdevtemplate | 5 - parts/appwizard/common/dockbook.kdevtemplate | 64 ++ parts/appwizard/common/dockbook.tdevtemplate | 64 -- parts/appwizard/common/gnome2.kdevtemplate | 5 + parts/appwizard/common/gnome2.tdevtemplate | 5 - parts/appwizard/common/gnu.kdevtemplate | 5 + parts/appwizard/common/gnu.tdevtemplate | 5 - parts/appwizard/common/incadmin.kdevtemplate | 5 + parts/appwizard/common/incadmin.tdevtemplate | 5 - parts/appwizard/common/kde-Makefile.am | 22 + parts/appwizard/common/kde-Makefile.cvs | 10 + parts/appwizard/common/kde-app.lsm | 14 + parts/appwizard/common/kde-doc-Makefile.am | 6 + parts/appwizard/common/kde-doc-en-Makefile.am | 2 + parts/appwizard/common/kde-po-Makefile.am | 1 + parts/appwizard/common/scons.kdevtemplate | 5 + parts/appwizard/common/scons.tdevtemplate | 5 - parts/appwizard/common/scons/admin/kde.py | 856 ++++++++++++++++++++++++++ parts/appwizard/common/scons/admin/tde.py | 856 -------------------------- parts/appwizard/common/tde-Makefile.am | 22 - parts/appwizard/common/tde-Makefile.cvs | 10 - parts/appwizard/common/tde-app.lsm | 14 - parts/appwizard/common/tde-doc-Makefile.am | 6 - parts/appwizard/common/tde-doc-en-Makefile.am | 2 - parts/appwizard/common/tde-po-Makefile.am | 1 - parts/appwizard/importdlg.cpp | 12 +- parts/appwizard/importdlg.h | 2 +- parts/appwizard/imports/CMakeLists.txt | 8 +- parts/appwizard/imports/Makefile.am | 6 +- parts/appwizard/imports/ada.tdevelop | 12 +- parts/appwizard/imports/c-auto.tdevelop | 16 +- parts/appwizard/imports/c.tdevelop | 18 +- parts/appwizard/imports/cpp-auto.tdevelop | 16 +- parts/appwizard/imports/cpp.tdevelop | 18 +- parts/appwizard/imports/fortran-auto.tdevelop | 12 +- parts/appwizard/imports/fortran.tdevelop | 18 +- parts/appwizard/imports/gnome.tdevelop | 22 +- parts/appwizard/imports/java-ant.tdevelop | 14 +- parts/appwizard/imports/java-auto.tdevelop | 10 +- parts/appwizard/imports/java.tdevelop | 10 +- parts/appwizard/imports/kde | 5 + parts/appwizard/imports/kde.tdevelop | 73 +++ parts/appwizard/imports/pascal.tdevelop | 12 +- parts/appwizard/imports/perl.tdevelop | 12 +- parts/appwizard/imports/php.tdevelop | 20 +- parts/appwizard/imports/python.tdevelop | 16 +- parts/appwizard/imports/qt-auto.tdevelop | 16 +- parts/appwizard/imports/qt.tdevelop | 18 +- parts/appwizard/imports/qt4qmake.tdevelop | 20 +- parts/appwizard/imports/qtqmake.tdevelop | 20 +- parts/appwizard/imports/qttmake.tdevelop | 16 +- parts/appwizard/imports/ruby.tdevelop | 18 +- parts/appwizard/imports/tde | 5 - parts/appwizard/imports/tde.tdevelop | 73 --- parts/appwizard/kdevappwizard.desktop | 87 +++ parts/appwizard/kdevappwizard.rc | 10 + parts/appwizard/kdevfile.cpp | 59 ++ parts/appwizard/kdevfile.h | 57 ++ parts/appwizard/kdevlicense.cpp | 116 ++++ parts/appwizard/kdevlicense.h | 75 +++ parts/appwizard/profilesupport.cpp | 4 +- parts/appwizard/profilesupport.h | 4 +- parts/appwizard/tdevappwizard.desktop | 87 --- parts/appwizard/tdevappwizard.rc | 10 - parts/appwizard/tdevfile.cpp | 59 -- parts/appwizard/tdevfile.h | 57 -- parts/appwizard/tdevlicense.cpp | 116 ---- parts/appwizard/tdevlicense.h | 75 --- 79 files changed, 1746 insertions(+), 1746 deletions(-) create mode 100644 parts/appwizard/common/admin.kdevtemplate delete mode 100644 parts/appwizard/common/admin.tdevtemplate create mode 100644 parts/appwizard/common/dockbook.kdevtemplate delete mode 100644 parts/appwizard/common/dockbook.tdevtemplate create mode 100644 parts/appwizard/common/gnome2.kdevtemplate delete mode 100644 parts/appwizard/common/gnome2.tdevtemplate create mode 100644 parts/appwizard/common/gnu.kdevtemplate delete mode 100644 parts/appwizard/common/gnu.tdevtemplate create mode 100644 parts/appwizard/common/incadmin.kdevtemplate delete mode 100644 parts/appwizard/common/incadmin.tdevtemplate create mode 100644 parts/appwizard/common/kde-Makefile.am create mode 100644 parts/appwizard/common/kde-Makefile.cvs create mode 100644 parts/appwizard/common/kde-app.lsm create mode 100644 parts/appwizard/common/kde-doc-Makefile.am create mode 100644 parts/appwizard/common/kde-doc-en-Makefile.am create mode 100644 parts/appwizard/common/kde-po-Makefile.am create mode 100644 parts/appwizard/common/scons.kdevtemplate delete mode 100644 parts/appwizard/common/scons.tdevtemplate create mode 100644 parts/appwizard/common/scons/admin/kde.py delete mode 100644 parts/appwizard/common/scons/admin/tde.py delete mode 100644 parts/appwizard/common/tde-Makefile.am delete mode 100644 parts/appwizard/common/tde-Makefile.cvs delete mode 100644 parts/appwizard/common/tde-app.lsm delete mode 100644 parts/appwizard/common/tde-doc-Makefile.am delete mode 100644 parts/appwizard/common/tde-doc-en-Makefile.am delete mode 100644 parts/appwizard/common/tde-po-Makefile.am create mode 100644 parts/appwizard/imports/kde create mode 100644 parts/appwizard/imports/kde.tdevelop delete mode 100644 parts/appwizard/imports/tde delete mode 100644 parts/appwizard/imports/tde.tdevelop create mode 100644 parts/appwizard/kdevappwizard.desktop create mode 100644 parts/appwizard/kdevappwizard.rc create mode 100644 parts/appwizard/kdevfile.cpp create mode 100644 parts/appwizard/kdevfile.h create mode 100644 parts/appwizard/kdevlicense.cpp create mode 100644 parts/appwizard/kdevlicense.h delete mode 100644 parts/appwizard/tdevappwizard.desktop delete mode 100644 parts/appwizard/tdevappwizard.rc delete mode 100644 parts/appwizard/tdevfile.cpp delete mode 100644 parts/appwizard/tdevfile.h delete mode 100644 parts/appwizard/tdevlicense.cpp delete mode 100644 parts/appwizard/tdevlicense.h (limited to 'parts/appwizard') diff --git a/parts/appwizard/CMakeLists.txt b/parts/appwizard/CMakeLists.txt index 8a69f06e..bdeaf541 100644 --- a/parts/appwizard/CMakeLists.txt +++ b/parts/appwizard/CMakeLists.txt @@ -35,18 +35,18 @@ link_directories( ##### other data ################################ -install( FILES tdevappwizard.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES tdevappwizard.rc DESTINATION ${DATA_INSTALL_DIR}/tdevappwizard ) +install( FILES kdevappwizard.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) +install( FILES kdevappwizard.rc DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard ) -##### libtdevappwizard (module) ################# +##### libkdevappwizard (module) ################# -tde_add_kpart( libtdevappwizard AUTOMOC +tde_add_kpart( libkdevappwizard AUTOMOC SOURCES appwizardfactory.cpp appwizardpart.cpp appwizarddlg.cpp importdlg.cpp filepropspagebase.ui filepropspage.cpp appwizarddlgbase.ui importdlgbase.ui misc.cpp vcs_form.ui - tdevfile.cpp tdevlicense.cpp profilesupport.cpp + kdevfile.cpp kdevlicense.cpp profilesupport.cpp LINK profileengine-shared tdevelop-shared DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/parts/appwizard/Makefile.am b/parts/appwizard/Makefile.am index 012f6f29..34af3163 100644 --- a/parts/appwizard/Makefile.am +++ b/parts/appwizard/Makefile.am @@ -7,22 +7,22 @@ INCLUDES = -I$(top_srcdir)/lib/interfaces \ -I$(top_srcdir)/lib/interfaces/extras -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/widgets \ -I$(top_srcdir)/src/profileengine/lib $(all_includes) -kde_module_LTLIBRARIES = libtdevappwizard.la -libtdevappwizard_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -libtdevappwizard_la_LIBADD = $(top_builddir)/lib/libtdevelop.la \ - $(top_builddir)/lib/interfaces/extras/libtdevextras.la $(top_builddir)/lib/util/libtdevutil.la \ - $(top_builddir)/lib/widgets/propeditor/libtdevpropertyeditor.la $(top_builddir)/src/profileengine/lib/libprofileengine.la +kde_module_LTLIBRARIES = libkdevappwizard.la +libkdevappwizard_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) +libkdevappwizard_la_LIBADD = $(top_builddir)/lib/libtdevelop.la \ + $(top_builddir)/lib/interfaces/extras/libkdevextras.la $(top_builddir)/lib/util/libkdevutil.la \ + $(top_builddir)/lib/widgets/propeditor/libkdevpropertyeditor.la $(top_builddir)/src/profileengine/lib/libprofileengine.la -libtdevappwizard_la_SOURCES = appwizardfactory.cpp appwizardpart.cpp \ +libkdevappwizard_la_SOURCES = appwizardfactory.cpp appwizardpart.cpp \ appwizarddlg.cpp importdlg.cpp filepropspagebase.ui filepropspage.cpp \ appwizarddlgbase.ui importdlgbase.ui misc.cpp vcs_form.ui\ - tdevfile.cpp tdevlicense.cpp profilesupport.cpp + kdevfile.cpp kdevlicense.cpp profilesupport.cpp METASOURCES = AUTO servicedir = $(kde_servicesdir) -service_DATA = tdevappwizard.desktop +service_DATA = kdevappwizard.desktop -rcdir = $(kde_datadir)/tdevappwizard -rc_DATA = tdevappwizard.rc +rcdir = $(kde_datadir)/kdevappwizard +rc_DATA = kdevappwizard.rc noinst_HEADERS = profilesupport.h diff --git a/parts/appwizard/appwizarddlg.cpp b/parts/appwizard/appwizarddlg.cpp index 4cbf716d..d5160075 100644 --- a/parts/appwizard/appwizarddlg.cpp +++ b/parts/appwizard/appwizarddlg.cpp @@ -64,14 +64,14 @@ #include #include "domutil.h" -#include "tdevversioncontrol.h" -#include "tdevmakefrontend.h" -#include "tdevpartcontroller.h" -#include "tdevplugincontroller.h" -#include "tdevappfrontend.h" -#include "tdevplugininfo.h" -#include "tdevlicense.h" -#include "tdevcore.h" +#include "kdevversioncontrol.h" +#include "kdevmakefrontend.h" +#include "kdevpartcontroller.h" +#include "kdevplugincontroller.h" +#include "kdevappfrontend.h" +#include "kdevplugininfo.h" +#include "kdevlicense.h" +#include "kdevcore.h" #include "appwizardfactory.h" #include "appwizardpart.h" #include "filepropspage.h" @@ -309,8 +309,8 @@ AppWizardDialog::AppWizardDialog(AppWizardPart *part, TQWidget *parent, const ch appname_edit->setValidator(appname_edit_validator); // insert the licenses into the license_combo - TQDict< TDevLicense > lics( licenses() ); - TQDictIterator< TDevLicense > dit(lics); + TQDict< KDevLicense > lics( licenses() ); + TQDictIterator< KDevLicense > dit(lics); int idx=1; for( ; dit.current(); ++dit ) { @@ -356,8 +356,8 @@ void AppWizardDialog::loadVcs() } TQStringList args; TQObject *obj = factory->create(0, service->name().latin1(), - "TDevVCSIntegrator", args); - TDevVCSIntegrator *integrator = (TDevVCSIntegrator*) obj; + "KDevVCSIntegrator", args); + KDevVCSIntegrator *integrator = (KDevVCSIntegrator*) obj; if (!integrator) kdDebug(9010) << " failed to create vcs integrator " << service->name() << endl; @@ -418,20 +418,20 @@ void AppWizardDialog::licenseChanged() edit->setText( TQString() ); } } else { - TDevLicense* lic = licenses()[ license_combo->currentText() ]; + KDevLicense* lic = licenses()[ license_combo->currentText() ]; for (it = m_fileTemplates.begin(); it != m_fileTemplates.end(); ++it) { TQString style = (*it).style; TQMultiLineEdit *edit = (*it).edit; - TDevFile::CommentingStyle commentStyle = TDevFile::CPPStyle; + KDevFile::CommentingStyle commentStyle = KDevFile::CPPStyle; if (style == "PStyle") { - commentStyle = TDevFile::PascalStyle; + commentStyle = KDevFile::PascalStyle; } else if (style == "AdaStyle") { - commentStyle = TDevFile::AdaStyle; + commentStyle = KDevFile::AdaStyle; } else if (style == "ShellStyle") { - commentStyle = TDevFile::BashStyle; + commentStyle = KDevFile::BashStyle; } else if (style == "XMLStyle") { - commentStyle = TDevFile::XMLStyle; + commentStyle = KDevFile::XMLStyle; } TQString text; @@ -577,7 +577,7 @@ void AppWizardDialog::accept() if( license_combo->currentItem() != 0 ) { licenseName = license_combo->currentText(); - TDevLicense* lic = licenses()[ licenseName ]; + KDevLicense* lic = licenses()[ licenseName ]; if( lic ) { TQStringList files( lic->copyFiles() ); @@ -1273,7 +1273,7 @@ void AppWizardDialog::setPermissions(const installFile &file) } } -TQDict AppWizardDialog::licenses() +TQDict AppWizardDialog::licenses() { return m_licenses; } @@ -1291,7 +1291,7 @@ void AppWizardDialog::loadLicenses() TQString licPath( dirs->findResource( "licenses", *it ) ); kdDebug(9010) << "Loading license file: " << licPath << endl; TQString licName = licPath.mid( licPath.findRev('/') + 1 ); - TDevLicense* lic = new TDevLicense( licName, licPath ); + KDevLicense* lic = new KDevLicense( licName, licPath ); m_licenses.insert( licName, lic ); } // kdDebug(9010) << "======================== Done loadLicenses" << endl; diff --git a/parts/appwizard/appwizarddlg.h b/parts/appwizard/appwizarddlg.h index 4a160bd2..392cd1b6 100644 --- a/parts/appwizard/appwizarddlg.h +++ b/parts/appwizard/appwizarddlg.h @@ -32,12 +32,12 @@ class ProfileSupport; #include #include #include -#include "tdevversioncontrol.h" -#include "tdevvcsintegrator.h" +#include "kdevversioncontrol.h" +#include "kdevvcsintegrator.h" #include "appwizarddlgbase.h" #include "vcs_form.h" //#include "autoform.h" -#include "tdevlicense.h" +#include "kdevlicense.h" namespace PropertyLib { class PropertyList; @@ -132,7 +132,7 @@ public: protected: virtual void accept(); - virtual TQDict licenses(); + virtual TQDict licenses(); void loadLicenses(); protected slots: @@ -181,7 +181,7 @@ private: //data TQDict m_categoryMap; TQValueList m_categoryItems; //! A list of currently available version control systems -// TQDict m_availVcs; +// TQDict m_availVcs; TQHBoxLayout *m_custom_options_layout; PropertyLib::PropertyEditor *m_customOptions; @@ -195,8 +195,8 @@ private: //data TDEPopupMenu* m_favouritesMenu; TDEPopupMenu* m_templatesMenu; - TQDict m_licenses; - TQDict m_integrators; + TQDict m_licenses; + TQDict m_integrators; TQMap m_integratorDialogs; ProfileSupport *m_profileSupport; diff --git a/parts/appwizard/appwizardfactory.cpp b/parts/appwizard/appwizardfactory.cpp index 6749add0..5288105d 100644 --- a/parts/appwizard/appwizardfactory.cpp +++ b/parts/appwizard/appwizardfactory.cpp @@ -11,30 +11,30 @@ #include -#include +#include #include "appwizardfactory.h" -static const TDevPluginInfo data("tdevappwizard"); -K_EXPORT_COMPONENT_FACTORY( libtdevappwizard, AppWizardFactory ) +static const KDevPluginInfo data("kdevappwizard"); +K_EXPORT_COMPONENT_FACTORY( libkdevappwizard, AppWizardFactory ) AppWizardFactory::AppWizardFactory() - : TDevGenericFactory( data ) + : KDevGenericFactory( data ) { } TDEInstance *AppWizardFactory::createInstance() { - TDEInstance *instance = TDevGenericFactory::createInstance(); + TDEInstance *instance = KDevGenericFactory::createInstance(); TDEStandardDirs *dirs = instance->dirs(); - dirs->addResourceType("apptemplates", TDEStandardDirs::kde_default("data") + "tdevappwizard/templates/"); - dirs->addResourceType("appimports", TDEStandardDirs::kde_default("data") + "tdevappwizard/imports/"); - dirs->addResourceType("appimportfiles", TDEStandardDirs::kde_default("data") + "tdevappwizard/importfiles/"); + dirs->addResourceType("apptemplates", TDEStandardDirs::kde_default("data") + "kdevappwizard/templates/"); + dirs->addResourceType("appimports", TDEStandardDirs::kde_default("data") + "kdevappwizard/imports/"); + dirs->addResourceType("appimportfiles", TDEStandardDirs::kde_default("data") + "kdevappwizard/importfiles/"); return instance; } -const TDevPluginInfo *AppWizardFactory::info() +const KDevPluginInfo *AppWizardFactory::info() { return &data; } diff --git a/parts/appwizard/appwizardfactory.h b/parts/appwizard/appwizardfactory.h index 3de35631..3bbc6e1e 100644 --- a/parts/appwizard/appwizardfactory.h +++ b/parts/appwizard/appwizardfactory.h @@ -12,18 +12,18 @@ #ifndef _APPWIZARDFACTORY_H_ #define _APPWIZARDFACTORY_H_ -#include +#include #include "appwizardpart.h" -class TDevPluginInfo; +class KDevPluginInfo; -class AppWizardFactory : public TDevGenericFactory +class AppWizardFactory : public KDevGenericFactory { public: AppWizardFactory(); - static const TDevPluginInfo *info(); + static const KDevPluginInfo *info(); protected: virtual TDEInstance *createInstance(); diff --git a/parts/appwizard/appwizardpart.cpp b/parts/appwizard/appwizardpart.cpp index ada3b362..dd2fae65 100644 --- a/parts/appwizard/appwizardpart.cpp +++ b/parts/appwizard/appwizardpart.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -28,17 +28,17 @@ #include "importdlg.h" #include "appwizarddlg.h" #include "appwizardfactory.h" -#include -#include -#include -#include +#include +#include +#include +#include #include AppWizardPart::AppWizardPart(TQObject *parent, const char *name, const TQStringList &) - : TDevPlugin(AppWizardFactory::info(), parent, name ? name : "AppWizardPart") + : KDevPlugin(AppWizardFactory::info(), parent, name ? name : "AppWizardPart") { setInstance(AppWizardFactory::instance()); - setXMLFile("tdevappwizard.rc"); + setXMLFile("kdevappwizard.rc"); TDEAction *action; diff --git a/parts/appwizard/appwizardpart.h b/parts/appwizard/appwizardpart.h index 901d51ad..59280631 100644 --- a/parts/appwizard/appwizardpart.h +++ b/parts/appwizard/appwizardpart.h @@ -13,7 +13,7 @@ #define _APPWIZARDPART_H_ #include -#include "tdevplugin.h" +#include "kdevplugin.h" #include #include #include @@ -21,7 +21,7 @@ class AppWizardDialog; -class AppWizardPart : public TDevPlugin +class AppWizardPart : public KDevPlugin { Q_OBJECT diff --git a/parts/appwizard/common/CMakeLists.txt b/parts/appwizard/common/CMakeLists.txt index 81ee38b4..62a5b97b 100644 --- a/parts/appwizard/common/CMakeLists.txt +++ b/parts/appwizard/common/CMakeLists.txt @@ -20,7 +20,7 @@ generate_tar( gnome2.tar.gz gnome2 macros ) generate_tar( gnu.tar.gz gnu AUTHORS COPYING ChangeLog INSTALL NEWS README TODO ) generate_tar( wxwidgets.tar.gz wx macros ) generate_tar( incadmin.tar.gz incadmin config.guess config.sub depcomp install-sh ltmain.sh missing mkinstalldirs ) -generate_tar( scons.tar.gz scons configure admin/scons-mini.tar.bz2 admin/generic.py admin/tde.py ) +generate_tar( scons.tar.gz scons configure admin/scons-mini.tar.bz2 admin/generic.py admin/kde.py ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/admin.tar.gz @@ -29,18 +29,18 @@ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/gnome.tar.gz ${CMAKE_CURRENT_BINARY_DIR}/gnome2.tar.gz ${CMAKE_CURRENT_BINARY_DIR}/wxwidgets.tar.gz - tde-app.lsm tde-Makefile.am tde-Makefile.cvs + kde-app.lsm kde-Makefile.am kde-Makefile.cvs tde-configure.in.in tde-index.docbook - tde-po-Makefile.am tde-doc-Makefile.am - tde-doc-en-Makefile.am hi16-app-app.png + kde-po-Makefile.am kde-doc-Makefile.am + kde-doc-en-Makefile.am hi16-app-app.png hi32-app-app.png tde-app.desktop tde-part.desktop gnome-app.lsm gnome-Makefile.am gnome-Makefile.cvs gnome-pixmaps-Makefile.am gnome-app.png wx-configure.in wx-Makefile.am wx-Makefile.cvs COPYING COPYING.LIB LICENSE.QPL LICENSE.BSD - Artistic admin.tdevtemplate gnu.tdevtemplate - dockbook.tdevtemplate incadmin.tdevtemplate - gnome2.tdevtemplate scons.tdevtemplate + Artistic admin.kdevtemplate gnu.kdevtemplate + dockbook.kdevtemplate incadmin.kdevtemplate + gnome2.kdevtemplate scons.kdevtemplate ${CMAKE_CURRENT_BINARY_DIR}/scons.tar.gz - DESTINATION ${DATA_INSTALL_DIR}/tdevappwizard/template-common ) + DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template-common ) diff --git a/parts/appwizard/common/Makefile.am b/parts/appwizard/common/Makefile.am index e068df5b..2d6e5278 100644 --- a/parts/appwizard/common/Makefile.am +++ b/parts/appwizard/common/Makefile.am @@ -28,19 +28,19 @@ incadmin.tar.gz: gzip incadmin.tar scons.tar.gz: - $(TAR) -cf scons.tar --exclude=.svn -C $(srcdir)/scons configure admin/scons-mini.tar.bz2 admin/generic.py admin/tde.py + $(TAR) -cf scons.tar --exclude=.svn -C $(srcdir)/scons configure admin/scons-mini.tar.bz2 admin/generic.py admin/kde.py gzip scons.tar -appwizarddatadir = ${kde_datadir}/tdevappwizard +appwizarddatadir = ${kde_datadir}/kdevappwizard commondatadir = ${appwizarddatadir}/template-common commondata_DATA = admin.tar.gz gnu.tar.gz incadmin.tar.gz gnome.tar.gz gnome2.tar.gz wxwidgets.tar.gz \ - tde-app.lsm tde-Makefile.am tde-Makefile.cvs tde-configure.in.in \ - tde-index.docbook tde-po-Makefile.am tde-doc-Makefile.am tde-doc-en-Makefile.am \ + kde-app.lsm kde-Makefile.am kde-Makefile.cvs tde-configure.in.in \ + tde-index.docbook kde-po-Makefile.am kde-doc-Makefile.am kde-doc-en-Makefile.am \ hi16-app-app.png hi32-app-app.png tde-app.desktop tde-part.desktop \ gnome-app.lsm gnome-Makefile.am gnome-Makefile.cvs \ gnome-pixmaps-Makefile.am gnome-app.png \ wx-configure.in wx-Makefile.am wx-Makefile.cvs \ COPYING COPYING.LIB LICENSE.QPL LICENSE.BSD Artistic \ - admin.tdevtemplate gnu.tdevtemplate dockbook.tdevtemplate\ - incadmin.tdevtemplate gnome2.tdevtemplate scons.tdevtemplate scons.tar.gz + admin.kdevtemplate gnu.kdevtemplate dockbook.kdevtemplate\ + incadmin.kdevtemplate gnome2.kdevtemplate scons.kdevtemplate scons.tar.gz diff --git a/parts/appwizard/common/admin.kdevtemplate b/parts/appwizard/common/admin.kdevtemplate new file mode 100644 index 00000000..73573b47 --- /dev/null +++ b/parts/appwizard/common/admin.kdevtemplate @@ -0,0 +1,5 @@ +[ADMIN] +Type=install archive +Source=%{tdevelop}/template-common/admin.tar.gz +Dest=%{dest} +Process=false diff --git a/parts/appwizard/common/admin.tdevtemplate b/parts/appwizard/common/admin.tdevtemplate deleted file mode 100644 index 73573b47..00000000 --- a/parts/appwizard/common/admin.tdevtemplate +++ /dev/null @@ -1,5 +0,0 @@ -[ADMIN] -Type=install archive -Source=%{tdevelop}/template-common/admin.tar.gz -Dest=%{dest} -Process=false diff --git a/parts/appwizard/common/dockbook.kdevtemplate b/parts/appwizard/common/dockbook.kdevtemplate new file mode 100644 index 00000000..41b65f62 --- /dev/null +++ b/parts/appwizard/common/dockbook.kdevtemplate @@ -0,0 +1,64 @@ +[DOCSOPT] +Type = value +ValueType=bool +Value=INSTALL_DOCS +Comment= Install Docbook documentation templates. +Comment[ca]= Instal·la plantilles de documentació en Docbook. +Comment[da]= Installerer Docbook dokumentationsskabeloner. +Comment[de]= Installiert Docbook-Vorlagen für Dokumentation +Comment[el]= Εγκατάσταση προτύπων τεκμηρίωσης Docbook. +Comment[es]=Instalar plantillas de documentación Docbook. +Comment[et]= Docbook-dokumendimallide paigaldamine. +Comment[eu]= Instalatu Docbook dokumentazioaren txantiloiak. +Comment[fa]= قالبهای مستندات Docbook را نصب می‌کند. +Comment[fr]=Installe des modèles de documentation en Docbook. +Comment[gl]=Instalar modelos de documentación Docbook +Comment[hu]=DocBook-alapú dokumentációsablonok telepítése. +Comment[it]=Installa modelli di documentazione docbook. +Comment[ja]=Docbook ドキュメントテンプレートをインストール +Comment[ms]=Pasang templat dokumentasi Docbook. +Comment[nds]= Docbook-Dokmentatschoonvörlagen installeren +Comment[ne]= डकबुक मिसिलीकरण टेम्प्लेट स्थापना गर्नुहोस् +Comment[nl]=Installeert Docbook-documentatie-sjablonen. +Comment[pl]=Instalacja szablonów dokumentacji Docbook. +Comment[pt]= Instala os modelos de documentação em Docbook. +Comment[pt_BR]= Instala os modelos de documentação em Docbook. +Comment[ru]=Установка шаблонов Docbook. +Comment[sk]=Nainštaluje šablóny dokumentácie Docbook. +Comment[sr]=Инсталира Docbook документационе шаблоне. +Comment[sr@Latn]=Instalira Docbook dokumentacione šablone. +Comment[sv]= Installera Docbook-dokumentationsmallar. +Comment[tr]=Docbook belgelendirme şablonlarını yükle. +Comment[zh_CN]=安装 Docbook 文档模板。 +Comment[zh_TW]=安裝 Docbook 文件樣本。 +Default=true + +[DOCSDIR] +Type=mkdir +Dir=%{dest}/doc +Option=INSTALL_DOCS + +[DOCSDIREN] +Type=mkdir +Dir=%{dest}/doc/en +Option=INSTALL_DOCS + +[DOCSMAKEFILE.AM1] +Type=install +Source=%{tdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am +Option=INSTALL_DOCS + +[DOCSMAKEFILE.AM2] +Type=install +Source=%{tdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am +Option=INSTALL_DOCS + +[DOCS] +Type=install +Source=%{tdevelop}/template-common/tde-index.docbook +Dest=%{dest}/doc/en/index.docbook +Option=INSTALL_DOCS + + diff --git a/parts/appwizard/common/dockbook.tdevtemplate b/parts/appwizard/common/dockbook.tdevtemplate deleted file mode 100644 index 41b65f62..00000000 --- a/parts/appwizard/common/dockbook.tdevtemplate +++ /dev/null @@ -1,64 +0,0 @@ -[DOCSOPT] -Type = value -ValueType=bool -Value=INSTALL_DOCS -Comment= Install Docbook documentation templates. -Comment[ca]= Instal·la plantilles de documentació en Docbook. -Comment[da]= Installerer Docbook dokumentationsskabeloner. -Comment[de]= Installiert Docbook-Vorlagen für Dokumentation -Comment[el]= Εγκατάσταση προτύπων τεκμηρίωσης Docbook. -Comment[es]=Instalar plantillas de documentación Docbook. -Comment[et]= Docbook-dokumendimallide paigaldamine. -Comment[eu]= Instalatu Docbook dokumentazioaren txantiloiak. -Comment[fa]= قالبهای مستندات Docbook را نصب می‌کند. -Comment[fr]=Installe des modèles de documentation en Docbook. -Comment[gl]=Instalar modelos de documentación Docbook -Comment[hu]=DocBook-alapú dokumentációsablonok telepítése. -Comment[it]=Installa modelli di documentazione docbook. -Comment[ja]=Docbook ドキュメントテンプレートをインストール -Comment[ms]=Pasang templat dokumentasi Docbook. -Comment[nds]= Docbook-Dokmentatschoonvörlagen installeren -Comment[ne]= डकबुक मिसिलीकरण टेम्प्लेट स्थापना गर्नुहोस् -Comment[nl]=Installeert Docbook-documentatie-sjablonen. -Comment[pl]=Instalacja szablonów dokumentacji Docbook. -Comment[pt]= Instala os modelos de documentação em Docbook. -Comment[pt_BR]= Instala os modelos de documentação em Docbook. -Comment[ru]=Установка шаблонов Docbook. -Comment[sk]=Nainštaluje šablóny dokumentácie Docbook. -Comment[sr]=Инсталира Docbook документационе шаблоне. -Comment[sr@Latn]=Instalira Docbook dokumentacione šablone. -Comment[sv]= Installera Docbook-dokumentationsmallar. -Comment[tr]=Docbook belgelendirme şablonlarını yükle. -Comment[zh_CN]=安装 Docbook 文档模板。 -Comment[zh_TW]=安裝 Docbook 文件樣本。 -Default=true - -[DOCSDIR] -Type=mkdir -Dir=%{dest}/doc -Option=INSTALL_DOCS - -[DOCSDIREN] -Type=mkdir -Dir=%{dest}/doc/en -Option=INSTALL_DOCS - -[DOCSMAKEFILE.AM1] -Type=install -Source=%{tdevelop}/template-common/kde-doc-Makefile.am -Dest=%{dest}/doc/Makefile.am -Option=INSTALL_DOCS - -[DOCSMAKEFILE.AM2] -Type=install -Source=%{tdevelop}/template-common/kde-doc-en-Makefile.am -Dest=%{dest}/doc/en/Makefile.am -Option=INSTALL_DOCS - -[DOCS] -Type=install -Source=%{tdevelop}/template-common/tde-index.docbook -Dest=%{dest}/doc/en/index.docbook -Option=INSTALL_DOCS - - diff --git a/parts/appwizard/common/gnome2.kdevtemplate b/parts/appwizard/common/gnome2.kdevtemplate new file mode 100644 index 00000000..ce4e3f3d --- /dev/null +++ b/parts/appwizard/common/gnome2.kdevtemplate @@ -0,0 +1,5 @@ +[GNOME2] +Type=install archive +Source=%{tdevelop}/template-common/gnome2.tar.gz +Dest=%{dest} + diff --git a/parts/appwizard/common/gnome2.tdevtemplate b/parts/appwizard/common/gnome2.tdevtemplate deleted file mode 100644 index ce4e3f3d..00000000 --- a/parts/appwizard/common/gnome2.tdevtemplate +++ /dev/null @@ -1,5 +0,0 @@ -[GNOME2] -Type=install archive -Source=%{tdevelop}/template-common/gnome2.tar.gz -Dest=%{dest} - diff --git a/parts/appwizard/common/gnu.kdevtemplate b/parts/appwizard/common/gnu.kdevtemplate new file mode 100644 index 00000000..e1876440 --- /dev/null +++ b/parts/appwizard/common/gnu.kdevtemplate @@ -0,0 +1,5 @@ +[GNU] +Type=install archive +Source=%{tdevelop}/template-common/gnu.tar.gz +Dest=%{dest} + diff --git a/parts/appwizard/common/gnu.tdevtemplate b/parts/appwizard/common/gnu.tdevtemplate deleted file mode 100644 index e1876440..00000000 --- a/parts/appwizard/common/gnu.tdevtemplate +++ /dev/null @@ -1,5 +0,0 @@ -[GNU] -Type=install archive -Source=%{tdevelop}/template-common/gnu.tar.gz -Dest=%{dest} - diff --git a/parts/appwizard/common/incadmin.kdevtemplate b/parts/appwizard/common/incadmin.kdevtemplate new file mode 100644 index 00000000..d7fbfb61 --- /dev/null +++ b/parts/appwizard/common/incadmin.kdevtemplate @@ -0,0 +1,5 @@ +[INCADMIN] +Type=install archive +Source=%{tdevelop}/template-common/incadmin.tar.gz +Dest=%{dest} +Process=false diff --git a/parts/appwizard/common/incadmin.tdevtemplate b/parts/appwizard/common/incadmin.tdevtemplate deleted file mode 100644 index d7fbfb61..00000000 --- a/parts/appwizard/common/incadmin.tdevtemplate +++ /dev/null @@ -1,5 +0,0 @@ -[INCADMIN] -Type=install archive -Source=%{tdevelop}/template-common/incadmin.tar.gz -Dest=%{dest} -Process=false diff --git a/parts/appwizard/common/kde-Makefile.am b/parts/appwizard/common/kde-Makefile.am new file mode 100644 index 00000000..06057100 --- /dev/null +++ b/parts/appwizard/common/kde-Makefile.am @@ -0,0 +1,22 @@ +SUBDIRS = $(TOPSUBDIRS) + +$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs + cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ; + +$(top_srcdir)/subdirs: + cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs + +$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in + @cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4 + +MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files + +package-messages: + cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common package-messages + $(MAKE) -C po merge + +EXTRA_DIST = admin %{LICENSEFILE} configure.in.in + +dist-hook: + cd $(top_distdir) && perl admin/am_edit -padmin + cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs diff --git a/parts/appwizard/common/kde-Makefile.cvs b/parts/appwizard/common/kde-Makefile.cvs new file mode 100644 index 00000000..4c0afd1a --- /dev/null +++ b/parts/appwizard/common/kde-Makefile.cvs @@ -0,0 +1,10 @@ +all: + @echo "This Makefile is only for the CVS repository" + @echo "This will be deleted before making the distribution" + @echo "" + $(MAKE) -f admin/Makefile.common cvs + +dist: + $(MAKE) -f admin/Makefile.common dist + +.SILENT: diff --git a/parts/appwizard/common/kde-app.lsm b/parts/appwizard/common/kde-app.lsm new file mode 100644 index 00000000..06055a96 --- /dev/null +++ b/parts/appwizard/common/kde-app.lsm @@ -0,0 +1,14 @@ +Begin4 +Title: $APPNAME +Version: R14.0.0 +Entered-date: 2010-05-10 +Description: .... for the Trinity Desktop Environment +Keywords: TDE Qt +Author: %{AUTHOR} <%{EMAIL}> +Maintained-by: The Trinity Desktop Environment (TDE) http://www.trinitydesktop.org/ +Primary-site: http://git.trinitydesktop.org/cgit/ +Alternate-site: +Original-site: +Platforms: Linux and other Unices running TDE +Copying-policy: GPL +End diff --git a/parts/appwizard/common/kde-doc-Makefile.am b/parts/appwizard/common/kde-doc-Makefile.am new file mode 100644 index 00000000..a1f777a1 --- /dev/null +++ b/parts/appwizard/common/kde-doc-Makefile.am @@ -0,0 +1,6 @@ +# the SUBDIRS is filled automatically by am_edit. If files are +# in this directory they are installed into the english dir + +KDE_LANG = en +KDE_DOCS = %{APPNAMELC} +SUBDIRS = $(AUTODIRS) diff --git a/parts/appwizard/common/kde-doc-en-Makefile.am b/parts/appwizard/common/kde-doc-en-Makefile.am new file mode 100644 index 00000000..bdd63b79 --- /dev/null +++ b/parts/appwizard/common/kde-doc-en-Makefile.am @@ -0,0 +1,2 @@ +KDE_DOCS = %{APPNAMELC} +KDE_LANG = en diff --git a/parts/appwizard/common/kde-po-Makefile.am b/parts/appwizard/common/kde-po-Makefile.am new file mode 100644 index 00000000..0fa209cd --- /dev/null +++ b/parts/appwizard/common/kde-po-Makefile.am @@ -0,0 +1 @@ +POFILES = AUTO diff --git a/parts/appwizard/common/scons.kdevtemplate b/parts/appwizard/common/scons.kdevtemplate new file mode 100644 index 00000000..84ed350f --- /dev/null +++ b/parts/appwizard/common/scons.kdevtemplate @@ -0,0 +1,5 @@ +[SCONS] +Type=install archive +Source=%{tdevelop}/template-common/scons.tar.gz +Dest=%{dest} +Process=false diff --git a/parts/appwizard/common/scons.tdevtemplate b/parts/appwizard/common/scons.tdevtemplate deleted file mode 100644 index 84ed350f..00000000 --- a/parts/appwizard/common/scons.tdevtemplate +++ /dev/null @@ -1,5 +0,0 @@ -[SCONS] -Type=install archive -Source=%{tdevelop}/template-common/scons.tar.gz -Dest=%{dest} -Process=false diff --git a/parts/appwizard/common/scons/admin/kde.py b/parts/appwizard/common/scons/admin/kde.py new file mode 100644 index 00000000..d194fd84 --- /dev/null +++ b/parts/appwizard/common/scons/admin/kde.py @@ -0,0 +1,856 @@ +# Made from scons qt.py and (heavily) modified into kde.py +# Thomas Nagy, 2004, 2005 + +""" +Run scons -h to display the associated help, or look below .. +""" + +BOLD ="\033[1m" +RED ="\033[91m" +GREEN ="\033[92m" +YELLOW ="\033[1m" #"\033[93m" # unreadable on white backgrounds +CYAN ="\033[96m" +NORMAL ="\033[0m" + +import os, re, types + +# Returns the name of the shared object (i.e. libtdeui.so.4) +# referenced by a libtool archive (like libtdeui.la) +def getSOfromLA(lafile): + contents = open(lafile, 'r').read() + match = re.search("^dlname='([^']*)'$", contents, re.M) + if match: + return match.group(1) + return None + +def exists(env): + return True + +def detect_kde(env): + """ Detect the qt and kde environment using tde-config mostly """ + + prefix = env['ARGS'].get('prefix', None) + execprefix = env['ARGS'].get('execprefix', None) + datadir = env['ARGS'].get('datadir', None) + libdir = env['ARGS'].get('libdir', None) + libsuffix = env['ARGS'].get('libsuffix', '') + kdeincludes = env['ARGS'].get('kdeincludes', None) + tdelibs = env['ARGS'].get('tdelibs', None) + qtincludes = env['ARGS'].get('qtincludes', None) + qtlibs = env['ARGS'].get('qtlibs', None) + + if libdir: + libdir = libdir+libsuffix + + ## Detect the kde libraries + print "Checking for tde-config : ", + kde_config = os.popen("which tde-config 2>/dev/null").read().strip() + if len(kde_config): + print GREEN+"tde-config was found"+NORMAL + else: + print RED+"tde-config was NOT found in your PATH"+NORMAL + print "Make sure kde is installed properly" + print "(missing package tdebase-devel?)" + env.Exit(1) + env['TDEDIR'] = os.popen('tde-config -prefix').read().strip() + + print "Checking for kde version : ", + kde_version = os.popen("tde-config --version|grep KDE").read().strip().split()[1] + if int(kde_version[0]) != 3 or int(kde_version[2]) < 2: + print RED+kde_version + print RED+"Your kde version can be too old"+NORMAL + print RED+"Please make sure kde is at least 3.2"+NORMAL + else: + print GREEN+kde_version+NORMAL + + ## Detect the qt library + print "Checking for the qt library : ", + qtdir = os.getenv("QTDIR") + if qtdir: + print GREEN+"qt is in "+qtdir+NORMAL + else: + libdir = os.popen('tde-config --expandvars --install lib').read().strip() + libtdeuiSO = libdir+'/'+getSOfromLA(libdir+'/libtdeui.la') + m = re.search('(.*)/lib/libqt.*', os.popen('ldd ' + libtdeuiSO + ' | grep libqt').read().strip().split()[2]) + if m: + qtdir = m.group(1) + print YELLOW+"qt was found as "+m.group(1)+NORMAL + else: + print RED+"qt was not found"+NORMAL + print RED+"Please set QTDIR first (/usr/lib/qt3?)"+NORMAL + env.Exit(1) + env['QTDIR'] = qtdir.strip() + + ## Find the necessary programs uic and moc + print "Checking for uic : ", + uic = qtdir + "/bin/uic" + if os.path.isfile(uic): + print GREEN+"uic was found as "+uic+NORMAL + else: + uic = os.popen("which uic 2>/dev/null").read().strip() + if len(uic): + print YELLOW+"uic was found as "+uic+NORMAL + else: + uic = os.popen("which uic 2>/dev/null").read().strip() + if len(uic): + print YELLOW+"uic was found as "+uic+NORMAL + else: + print RED+"uic was not found - set QTDIR put it in your PATH ?"+NORMAL + env.Exit(1) + env['QT_UIC'] = uic + + print "Checking for moc : ", + moc = qtdir + "/bin/moc" + if os.path.isfile(moc): + print GREEN + "moc was found as " + moc + NORMAL + else: + moc = os.popen("which moc 2>/dev/null").read().strip() + if len(moc): + print YELLOW + "moc was found as " + moc + NORMAL + elif os.path.isfile("/usr/share/qt3/bin/moc"): + moc = "/usr/share/qt3/bin/moc" + print YELLOW + "moc was found as " + moc + NORMAL + else: + print RED + "moc was not found - set QTDIR or put it in your PATH ?" + NORMAL + env.Exit(1) + env['QT_MOC'] = moc + + ## check for the qt and kde includes + print "Checking for the qt includes : ", + if qtincludes and os.path.isfile(qtincludes + "/qtqlayout.h"): + # The user told where to look for and it looks valid + print GREEN + "ok " + qtincludes + NORMAL + else: + if os.path.isfile(qtdir + "/include/qtqlayout.h"): + # Automatic detection + print GREEN + "ok " + qtdir + "/include/ " + NORMAL + qtincludes = qtdir + "/include/" + elif os.path.isfile("/usr/include/qt3/qtqlayout.h"): + # Debian probably + print YELLOW + "the qt headers were found in /usr/include/qt3/ " + NORMAL + qtincludes = "/usr/include/qt3" + else: + print RED + "the qt headers were not found" + NORMAL + env.Exit(1) + + print "Checking for the kde includes : ", + kdeprefix = os.popen("tde-config --prefix").read().strip() + if not kdeincludes: + kdeincludes = kdeprefix+"/include/" + if os.path.isfile(kdeincludes + "/klineedit.h"): + print GREEN + "ok " + kdeincludes + NORMAL + else: + if os.path.isfile(kdeprefix+"/include/tde/klineedit.h"): + # Debian, Fedora probably + print YELLOW + "the kde headers were found in " + kdeprefix + "/include/tde/" + NORMAL + kdeincludes = kdeprefix + "/include/tde/" + else: + print RED + "The kde includes were NOT found" + NORMAL + env.Exit(1) + + if prefix: + ## use the user-specified prefix + if not execprefix: + execprefix = prefix + if not datadir: + datadir=prefix+"/share" + if not libdir: + libdir=execprefix+"/lib"+libsuffix + + subst_vars = lambda x: x.replace('${exec_prefix}', execprefix).replace('${datadir}',datadir).replace('${libdir}', libdir) + debian_fix = lambda x: x.replace('/usr/share', '${datadir}') + env['KDEBIN'] = subst_vars(os.popen('tde-config --install exe').read().strip()) + env['KDEAPPS'] = subst_vars(os.popen('tde-config --install apps').read().strip()) + env['KDEDATA'] = subst_vars(os.popen('tde-config --install data').read().strip()) + env['KDEMODULE']= subst_vars(os.popen('tde-config --install module').read().strip()) + env['KDELOCALE']= subst_vars(os.popen('tde-config --install locale').read().strip()) + env['KDEDOC'] = subst_vars( debian_fix(os.popen('tde-config --install html').read().strip()) ) + env['KDEKCFG'] = subst_vars(os.popen('tde-config --install kcfg').read().strip()) + env['KDEXDG'] = subst_vars(os.popen('tde-config --install xdgdata-apps').read().strip()) + env['KDEXDGDIR']= subst_vars(os.popen('tde-config --install xdgdata-dirs').read().strip()) + env['KDEMENU'] = subst_vars(os.popen('tde-config --install apps').read().strip()) + env['KDEMIME'] = subst_vars(os.popen('tde-config --install mime').read().strip()) + env['KDEICONS'] = subst_vars(os.popen('tde-config --install icon').read().strip()) + env['KDESERV'] = subst_vars(os.popen('tde-config --install services').read().strip()) + else: + # the user has given no prefix, install as a normal kde app + env['PREFIX'] = os.popen('tde-config --prefix').read().strip() + env['KDEBIN'] = os.popen('tde-config --expandvars --install exe').read().strip() + env['KDEAPPS'] = os.popen('tde-config --expandvars --install apps').read().strip() + env['KDEDATA'] = os.popen('tde-config --expandvars --install data').read().strip() + env['KDEMODULE']= os.popen('tde-config --expandvars --install module').read().strip() + env['KDELOCALE']= os.popen('tde-config --expandvars --install locale').read().strip() + env['KDEDOC'] = os.popen('tde-config --expandvars --install html').read().strip() + env['KDEKCFG'] = os.popen('tde-config --expandvars --install kcfg').read().strip() + env['KDEXDG'] = os.popen('tde-config --expandvars --install xdgdata-apps').read().strip() + env['KDEXDGDIR']= os.popen('tde-config --expandvars --install xdgdata-dirs').read().strip() + env['KDEMENU'] = os.popen('tde-config --expandvars --install apps').read().strip() + env['KDEMIME'] = os.popen('tde-config --expandvars --install mime').read().strip() + env['KDEICONS'] = os.popen('tde-config --expandvars --install icon').read().strip() + env['KDESERV'] = os.popen('tde-config --expandvars --install services').read().strip() + + env['QTPLUGINS']=os.popen('tde-config --expandvars --install qtplugins').read().strip() + + ## kde libs and includes + env['KDEINCLUDEPATH']=kdeincludes + if not tdelibs: + tdelibs=os.popen('tde-config --expandvars --install lib').read().strip() + env['KDELIBPATH']=tdelibs + + ## qt libs and includes + env['QTINCLUDEPATH']=qtincludes + if not qtlibs: + qtlibs=qtdir+"/lib" + env['QTLIBPATH']=qtlibs + +def generate(env): + """"Set up the qt and kde environment and builders - the moc part is difficult to understand """ + if env['HELP']: + print """ +"""+BOLD+"""*** KDE options *** +-------------------"""+NORMAL+""" +"""+BOLD+"""* prefix """+NORMAL+""": base install path, ie: /usr/local +"""+BOLD+"""* execprefix """+NORMAL+""": install path for binaries, ie: /usr/bin +"""+BOLD+"""* datadir """+NORMAL+""": install path for the data, ie: /usr/local/share +"""+BOLD+"""* libdir """+NORMAL+""": install path for the libs, ie: /usr/lib +"""+BOLD+"""* libsuffix """+NORMAL+""": suffix of libraries on amd64, ie: 64, 32 +"""+BOLD+"""* kdeincludes"""+NORMAL+""": path to the kde includes (/usr/include/tde on debian, ...) +"""+BOLD+"""* qtincludes """+NORMAL+""": same punishment, for qt includes (/usr/include/qt on debian, ...) +"""+BOLD+"""* tdelibs """+NORMAL+""": path to the kde libs, for linking the programs +"""+BOLD+"""* qtlibs """+NORMAL+""": same punishment, for qt libraries +ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt +"""+NORMAL + + import SCons.Defaults + import SCons.Tool + import SCons.Util + + ui_extensions = [".ui"] + header_extensions = [".h", ".hxx", ".hpp", ".hh"] + source_extensions = [".cpp", ".cxx", ".cc"] + + def find_file(filename, paths, node_factory): + retval = None + for dir in paths: + node = node_factory(filename, dir) + if node.rexists(): + return node + return None + + class _Metasources: + """ Callable class, which works as an emitter for Programs, SharedLibraries + and StaticLibraries.""" + + def __init__(self, objBuilderName): + self.objBuilderName = objBuilderName + + def __call__(self, target, source, env): + """ Smart autoscan function. Gets the list of objects for the Program + or Lib. Adds objects and builders for the special qt files. """ + try: + if int(env.subst('$QT_AUTOSCAN')) == 0: + return target, source + except ValueError: + pass + + try: + qtdebug = int(env.subst('$QT_DEBUG')) + except ValueError: + qtdebug = 0 + + # some shortcuts used in the scanner + FS = SCons.Node.FS.default_fs + splitext = SCons.Util.splitext + objBuilder = getattr(env, self.objBuilderName) + + # some regular expressions: + # Q_OBJECT detection + q_object_search = re.compile(r'[^A-Za-z0-9]Q_OBJECT[^A-Za-z0-9]') + + # The following is kind of hacky to get builders working properly (FIXME) ?? + objBuilderEnv = objBuilder.env + objBuilder.env = env + mocBuilderEnv = env.Moc.env + env.Moc.env = env + + # make a deep copy for the result; MocH objects will be appended + out_sources = source[:] + + for obj in source: + if not obj.has_builder(): + # binary obj file provided + if qtdebug: + print "scons: qt: '%s' seems to be a binary. Discarded." % str(obj) + continue + cpp = obj.sources[0] + if not splitext(str(cpp))[1] in source_extensions: + if qtdebug: + print "scons: qt: '%s' is no cxx file. Discarded." % str(cpp) + # c or fortran source + continue + #cpp_contents = comment.sub('', cpp.get_contents()) + cpp_contents = cpp.get_contents() + + h = None + ui = None + + for ui_ext in ui_extensions: + # try to find the ui file in the corresponding source directory + uiname = splitext(cpp.name)[0] + ui_ext + ui = find_file(uiname, (cpp.get_dir(),), FS.File) + if ui: + if qtdebug: + print "scons: qt: found .ui file of header" #% (str(h), str(cpp)) + #h_contents = comment.sub('', h.get_contents()) + break + + # if we have a .ui file, do not continue, it is automatically handled by Uic + if ui: + continue + + for h_ext in header_extensions: + # try to find the header file in the corresponding source + # directory + hname = splitext(cpp.name)[0] + h_ext + h = find_file(hname, (cpp.get_dir(),), FS.File) + if h: + if qtdebug: + print "scons: qt: Scanning '%s' (header of '%s')" % (str(h), str(cpp)) + #h_contents = comment.sub('', h.get_contents()) + h_contents = h.get_contents() + break + + if not h and qtdebug: + print "scons: qt: no header for '%s'." % (str(cpp)) + if h and q_object_search.search(h_contents): + # h file with the Q_OBJECT macro found -> add .moc or _moc.cpp file + moc_cpp = None + + if env.has_key('NOMOCSCAN'): + moc_cpp = env.Moc(h) + else: + reg = '\n\s*#include\s*("|<)'+splitext(cpp.name)[0]+'.moc("|>)' + meta_object_search = re.compile(reg) + if meta_object_search.search(cpp_contents): + moc_cpp = env.Moc(h) + else: + moc_cpp = env.Moccpp(h) + moc_o = objBuilder(moc_cpp) + out_sources.append(moc_o) + if qtdebug: + print "scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(moc_cpp[0])) + + if cpp and q_object_search.search(cpp_contents): + print "error, bksys cannot handle cpp files with Q_OBJECT classes" + print "if you are sure this is a feature worth the effort, " + print "report this to the authors tnagyemail-mail yahoo.fr" + + # restore the original env attributes (FIXME) + objBuilder.env = objBuilderEnv + env.Moc.env = mocBuilderEnv + + return (target, out_sources) + + MetasourcesShared = _Metasources('SharedObject') + MetasourcesStatic = _Metasources('StaticObject') + + CLVar = SCons.Util.CLVar + splitext = SCons.Util.splitext + Builder = SCons.Builder.Builder + + # Detect the environment - replaces ./configure implicitely and store the options into a cache + from SCons.Options import Options + cachefile=env['CACHEDIR']+'kde.cache.py' + opts = Options(cachefile) + opts.AddOptions( + ('PREFIX', 'root of the program installation'), + + ('QTDIR', 'root of qt directory'), + ('QTLIBPATH', 'path to the qt libraries'), + ('QTINCLUDEPATH', 'path to the qt includes'), + ('QT_UIC', 'moc directory'), + ('QT_MOC', 'moc executable command'), + ('QTPLUGINS', 'uic executable command'), + ('TDEDIR', 'root of kde directory'), + ('KDELIBPATH', 'path to the kde libs'), + ('KDEINCLUDEPATH', 'path to the kde includes'), + + ('KDEBIN', 'installation path of the kde binaries'), + ('KDEMODULE', 'installation path of the parts and libs'), + ('KDEAPPS', ''), + ('KDEDATA', 'installation path of the application data'), + ('KDELOCALE', ''), + ('KDEDOC', 'installation path of the application documentation'), + ('KDEKCFG', 'installation path of the .kcfg files'), + ('KDEXDG', 'installation path of the service types'), + ('KDEXDGDIR', 'installation path of the xdg service directories'), + ('KDEMENU', ''), + ('KDEMIME', 'installation path of to the mimetypes'), + ('KDEICONS', ''), + ('KDESERV', ''), + ) + opts.Update(env) + + # reconfigure when things are missing + if not env['HELP'] and (env['_CONFIGURE'] or not env.has_key('QTDIR') or not env.has_key('TDEDIR')): + detect_kde(env) + + # finally save the configuration to the cache file + opts.Save(cachefile, env) + + ## set default variables, one can override them in sconscript files + env.Append(CXXFLAGS = ['-I'+env['KDEINCLUDEPATH'], '-I'+env['QTINCLUDEPATH'] ]) + env.Append(LIBPATH = [env['KDELIBPATH'], env['QTLIBPATH'] ]) + + env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 + + env['QT_AUTOSCAN'] = 1 + env['QT_DEBUG'] = 0 + env['QT_UIC_HFLAGS'] = '-L $QTPLUGINS -nounload' + env['QT_UIC_CFLAGS'] = '$QT_UIC_HFLAGS -tr tr2i18n' + env['QT_LIBS'] = 'qt-mt' + env['QT_UICIMPLPREFIX'] = '' + env['QT_UICIMPLSUFFIX'] = '.cpp' + + env['QT_MOCHPREFIX'] = '' + env['QT_MOCHSUFFIX'] = '.moc' + env['KDE_KCFG_IMPLPREFIX'] = '' + env['KDE_KCFG_IMPL_HSUFFIX'] = '.h' + env['KDE_KCFG_IMPL_CSUFFIX'] = '.cpp' + env['KDE_SKEL_IMPL_SUFFIX'] = '.skel' + env['MEINPROC'] = 'meinproc' + env['MSGFMT'] = 'msgfmt' + + ## ui file processing + def uic_processing(target, source, env): + inc_kde = '#include \n#include \n' + inc_moc = '#include "%s"\n' % target[2].name + comp_h = '$QT_UIC $QT_UIC_HFLAGS -o %s %s' % (target[0].path, source[0].path) + comp_c = '$QT_UIC $QT_UIC_CFLAGS -impl %s %s' % (target[0].path, source[0].path) + comp_moc = '$QT_MOC -o %s %s' % (target[2].path, target[0].path) + + ret = env.Execute(comp_h) + if ret: + return ret + + dest = open( target[1].path, "w" ) + dest.write(inc_kde) + dest.close() + + ret = env.Execute( comp_c+" >> "+target[1].path ) + if ret: + return ret + + dest = open( target[1].path, "a" ) + dest.write(inc_moc) + dest.close() + + ret = env.Execute( comp_moc ) + return ret + + def uicEmitter(target, source, env): + adjustixes = SCons.Util.adjustixes + bs = SCons.Util.splitext(str(source[0].name))[0] + bs = os.path.join(str(target[0].get_dir()),bs) + # first target is automatically added by builder (.h file) + if len(target) < 2: + # second target is .cpp file + target.append(adjustixes(bs, + env.subst('$QT_UICIMPLPREFIX'), + env.subst('$QT_UICIMPLSUFFIX'))) + if len(target) < 3: + # third target is .moc file + target.append(adjustixes(bs, + env.subst('$QT_MOCHPREFIX'), + env.subst('$QT_MOCHSUFFIX'))) + return target, source + + UIC_BUILDER = Builder( + action = uic_processing, + emitter = uicEmitter, + suffix = '.h', + src_suffix = '.ui') + + ## moc file processing + env['QT_MOCCOM'] = ('$QT_MOC -o ${TARGETS[0]} $SOURCE') + + MOC_BUILDER = Builder( + action = '$QT_MOCCOM', + suffix = '.moc', + src_suffix = '.h') + + MOCCPP_BUILDER = Builder( + action = '$QT_MOCCOM', + suffix = '_moc.cpp', + src_suffix = '.h') + + ## kcfg file processing + def kcfgGenerator(target, source, env, for_signature): + act=[] + act.append('tdeconfig_compiler -d'+str(source[0].get_dir())+' '+source[1].path+' '+source[0].path) + return act + + def kcfgEmitter(target, source, env): + adjustixes = SCons.Util.adjustixes + bs = SCons.Util.splitext(str(source[0].name))[0] + bs = os.path.join(str(target[0].get_dir()),bs) + # .h file is automatically added + if len(target) < 2: + # add .cpp file + target.append(adjustixes(bs, env.subst('$KDE_KCFG_IMPLPREFIX'), env.subst('$KDE_KCFG_IMPL_CSUFFIX'))) + + if len(source) <2: + if not os.path.isfile(str(source[0])): + print RED+'kcfg file given'+str(source[0])+' does not exist !'+NORMAL + return target, source + kfcgfilename="" + kcfgFileDeclRx = re.compile("^[fF]ile\s*=\s*(.+)\s*$") + for line in file(str(source[0]), "r").readlines(): + match = kcfgFileDeclRx.match(line.strip()) + if match: + kcfgfilename = match.group(1) + break + source.append(str(source[0].get_dir())+'/'+kcfgfilename) + return target, source + + KCFG_BUILDER = Builder( + generator = kcfgGenerator, + emitter = kcfgEmitter, + suffix = '.h', + src_suffix = '.kcfgc') + + ## dcop processing + def dcopGenerator(target, source, env, for_signature): + act=[] + act.append('dcopidl '+source[0].path+' > '+target[1].path+'|| ( rm -f '+target[1].path+' ; false)') + act.append('dcopidl2cpp --c++-suffix cpp --no-Q_SIGNALS --no-stub '+target[1].path) + return act + + def dcopEmitter(target, source, env): + bs = SCons.Util.splitext(str(source[0].name))[0] + bs = os.path.join(str(target[0].get_dir()),bs) + target.append(bs+'.kidl') + #target.append(bs+'_skel.cpp') + return target, source + + DCOP_BUILDER = Builder( + generator = dcopGenerator, + emitter = dcopEmitter, + suffix = '_skel.cpp', + src_suffix = '.h') + + ## documentation processing + MEINPROC_BUILDER = Builder( + action = '$MEINPROC --check --cache $TARGET $SOURCE', + suffix = '.cache.bz2') + + ## translation files builder + TRANSFILES_BUILDER = Builder( + action = '$MSGFMT $SOURCE -o $TARGET', + suffix = '.gmo', + src_suffix = '.po') + + ## libtool file builder + def la_file(target, source, env): + dest=open(target[0].path, 'w') + sname=source[0].name + dest.write("dlname='%s'\n" % sname) + dest.write("library_names='%s %s %s'\n" % (sname, sname, sname)) + dest.write("old_library=''\n") + dest.write("dependency_libs=''\n") + dest.write("current=0\n") + dest.write("age=0\n") + dest.write("revision=0\n") + dest.write("installed=yes\n") + dest.write("shouldnotlink=no\n") + dest.write("dlopen=''\n") + dest.write("dlpreopen=''\n") + dest.write("libdir='%s'" % env['KDEMODULE']) + dest.close() + return 0 + + LA_BUILDER = Builder( + action = la_file, + suffix = '.la', + src_suffix = env['SHLIBSUFFIX']) + + ## register the builders + env['BUILDERS']['Uic'] = UIC_BUILDER + env['BUILDERS']['Moc'] = MOC_BUILDER + env['BUILDERS']['Moccpp'] = MOCCPP_BUILDER + env['BUILDERS']['Dcop'] = DCOP_BUILDER + env['BUILDERS']['Kcfg'] = KCFG_BUILDER + env['BUILDERS']['LaFile'] = LA_BUILDER + env['BUILDERS']['Meinproc'] = MEINPROC_BUILDER + env['BUILDERS']['Transfiles']= TRANSFILES_BUILDER + + static_obj, shared_obj = SCons.Tool.createObjBuilders(env) + static_obj.src_builder.append('Uic') + shared_obj.src_builder.append('Uic') + static_obj.src_builder.append('Kcfg') + shared_obj.src_builder.append('Kcfg') + static_obj.src_builder.append('LaFile') + shared_obj.src_builder.append('LaFile') + static_obj.src_builder.append('Meinproc') + shared_obj.src_builder.append('Meinproc') + static_obj.src_builder.append('Transfiles') + shared_obj.src_builder.append('Transfiles') + + ## Find the files to moc, dcop, and link against kde and qt + env.AppendUnique(PROGEMITTER = [MetasourcesStatic], SHLIBEMITTER=[MetasourcesShared], LIBEMITTER =[MetasourcesStatic]) + + ## Handy helpers for building kde programs + ## You should not have to modify them .. + + ## return a list of things + def make_list(e): + if type(e) is types.ListType: + return e + else: + return e.split() + + #import SCons.Util + skel_ext = [".skel", ".SKEL"] + def KDEfiles(lenv, target, source): + """ Returns a list of files for scons (handles kde tricks like .skel) + It also makes custom checks against double includes like : ['file.ui', 'file.cpp'] + (file.cpp is already included because of file.ui) """ + + src=[] + ui_files=[] + kcfg_files=[] + skel_files=[] + other_files=[] + + source_=make_list(source) + + # For each file, check wether it is a dcop file or not, and create the complete list of sources + for file in source_: + bs = SCons.Util.splitext(file)[0] + ext = SCons.Util.splitext(file)[1] + if ext in skel_ext: + lenv.Dcop(bs+'.h') + src.append(bs+'_skel.cpp') + elif ext == ".moch": + lenv.Moccpp(bs+'.h') + src.append(bs+'_moc.cpp') + else: + src.append(file) + + if ext == '.ui': + ui_files.append(bs) + elif ext == '.kcfgc': + kcfg_files.append(bs) + elif ext == '.skel': + skel_files.append(bs) + else: + other_files.append(bs) + + # Now check against typical newbie errors + for file in ui_files: + for ofile in other_files: + if ofile == file: + print RED+"WARNING: You have included "+file+".ui and another file of the same prefix"+NORMAL + print "Files generated by uic (file.h, file.cpp must not be included" + for file in kcfg_files: + for ofile in other_files: + if ofile == file: + print RED+"WARNING: You have included "+file+".kcfg and another file of the same prefix"+NORMAL + print "Files generated by tdeconfig_compiler (settings.h, settings.cpp) must not be included" + return src + + + """ + In the future, these functions will contain the code that will dump the + configuration for re-use from an IDE + """ + import glob + def KDEinstall(lenv, restype, subdir, files): + if not env['_INSTALL']: + return + basedir=env['DESTDIR'] + if len(restype)>0: + if not lenv.has_key(restype): + print RED+"unknown resource type "+restype+NORMAL + else: + basedir += lenv[restype]+'/' + #print file # <- useful to trace stuff :) + install_list = env.Install(basedir+subdir+'/', files) + env.Alias('install', install_list) + return install_list + + def KDEinstallas(lenv, restype, destfile, file): + if not env['_INSTALL']: + return + basedir=env['DESTDIR'] + if len(restype)>0: + if not lenv.has_key(restype): + print RED+"unknown resource type "+restype+NORMAL + else: + basedir += lenv[restype]+'/' + install_list = env.InstallAs(basedir+destfile, file) + env.Alias('install', install_list) + return install_list + + def KDEprogram(lenv, target, source): + """ Makes a kde program + The program is installed except if one sets env['NOAUTOINSTALL'] """ + src = KDEfiles(lenv, target, source) + program_list = lenv.Program(target, src) + if not lenv.has_key('NOAUTOINSTALL'): + KDEinstall(lenv, 'KDEBIN', '', target) + return program_list + + def KDEshlib(lenv, target, source, kdelib=0, libprefix='lib'): + """ Makes a shared library for kde (.la file for klibloader) + The library is installed except if one sets env['NOAUTOINSTALL'] """ + src = KDEfiles(lenv, target, source) + lenv['LIBPREFIX']=libprefix + library_list = lenv.SharedLibrary(target, src) + lafile_list = lenv.LaFile(target, library_list) + if not lenv.has_key('NOAUTOINSTALL'): + install_dir = 'KDEMODULE' + if kdelib==1: + install_dir = 'KDELIBPATH' + KDEinstall(lenv, install_dir, '', library_list) + KDEinstall(lenv, install_dir, '', lafile_list) + return library_list + + def KDEstaticlib(lenv, target, source): + """ Makes a static library for kde - in practice you should not use static libraries + 1. they take more memory than shared ones + 2. makefile.am needed it because of limitations + (cannot handle sources in separate folders - takes extra processing) """ + src = KDEfiles(lenv, target, source) + return lenv.StaticLibrary(target, src) + # do not install static libraries by default + + def KDEaddflags_cxx(lenv, fl): + """ Compilation flags for C++ programs """ + lenv.AppendUnique(CXXFLAGS = make_list(fl)) + + def KDEaddflags_c(lenv, fl): + """ Compilation flags for C programs """ + lenv.AppendUnique(CFLAGS = make_list(fl)) + + def KDEaddflags_link(lenv, fl): + """ Add link flags - Use this if KDEaddlibs below is not enough """ + lenv.AppendUnique(LINKFLAGS = make_list(fl)) + + def KDEaddlibs(lenv, libs): + """ Helper function """ + lenv.AppendUnique(LIBS = make_list(libs)) + + def KDEaddpaths_includes(lenv, paths): + """ Add new include paths """ + lenv.AppendUnique(CPPPATH = make_list(paths)) + + def KDEaddpaths_libs(lenv, paths): + """ Add paths to libraries """ + lenv.AppendUnique(LIBPATH = make_list(paths)) + + def KDElang(lenv, folder, appname): + """ Process translations (.po files) in a po/ dir """ + transfiles = glob.glob(folder+'/*.po') + for lang in transfiles: + result = lenv.Transfiles(lang) + country = SCons.Util.splitext(result[0].name)[0] + KDEinstallas(lenv, 'KDELOCALE', country+'/LC_MESSAGES/'+appname+'.mo', result) + + def subdirs(lenv, folderlist): + flist=make_list(folderlist) + for i in flist: + lenv.SConscript(i+"/SConscript") + + def KDEicon(lenv, icname='*', path='./'): + """ Emulates the behaviour of Makefile.am to install icons + Contributed by: "Andrey Golovizin" """ + type_dic = { 'action' : 'actions', 'app' : 'apps', 'device' : + 'devices', 'filesys' : 'filesystems', 'mime' : 'mimetypes' } + dir_dic = { + 'los' :'locolor/16x16', + 'lom' :'locolor/32x32', + 'him' :'hicolor/32x32', + 'hil' :'hicolor/48x48', + 'lo16' :'locolor/16x16', + 'lo22' :'locolor/22x22', + 'lo32' :'locolor/32x32', + 'hi16' :'hicolor/16x16', + 'hi22' :'hicolor/22x22', + 'hi32' :'hicolor/32x32', + 'hi48' :'hicolor/48x48', + 'hi64' :'hicolor/64x64', + 'hi128':'hicolor/128x128', + 'hisc' :'hicolor/scalable', + 'cr16' :'crystalsvg/16x16', + 'cr22' :'crystalsvg/22x22', + 'cr32' :'crystalsvg/32x32', + 'cr48' :'crystalsvg/48x48', + 'cr64' :'crystalsvg/64x64', + 'cr128':'crystalsvg/128x128', + 'crsc' :'crystalsvg/scalable' + } + + iconfiles = [] + for ext in "png xpm mng svg svgz".split(): + files = glob.glob(path+'/'+'*-*-%s.%s' % (icname, ext)) + iconfiles += files + for iconfile in iconfiles: + lst = iconfile.split('/') + filename = lst[ len(lst) - 1 ] + tmp = filename.split('-') + if len(tmp)!=3: + print RED+'WARNING: icon filename has unknown format: '+iconfile+NORMAL + continue + [icon_dir, icon_type, icon_filename]=tmp + try: + destfile = '%s/%s/%s/%s' % (lenv['KDEICONS'], dir_dic[icon_dir], type_dic[icon_type], icon_filename) + except KeyError: + print RED+'WARNING: unknown icon type: '+iconfile+NORMAL + continue + ## Do not use KDEinstallas here, as parsing from an ide will be necessary + if env['_INSTALL']: + env.Alias('install', env.InstallAs( env['DESTDIR']+'/'+destfile, iconfile ) ) + + def KDEuse(lenv, flags): + _flags=make_list(flags) + if 'environ' in _flags: + ## The scons developers advise against using this but it is mostly innocuous :) + import os + lenv.AppendUnique( ENV = os.environ ) + if not 'lang_qt' in _flags: + ## Use this define if you are using the kde translation scheme (.po files) + lenv.Append( CPPFLAGS = '-DQT_NO_TRANSLATION' ) + if 'rpath' in _flags: + ## Use this to set rpath - this may cause trouble if folders are moved (chrpath) + lenv.Append( RPATH = [env['QTLIBPATH'], env['KDELIBPATH'], env['KDEMODULE']] ) + if 'thread' in _flags: + ## Uncomment the following if you need threading support + lenv.KDEaddflags_cxx( ['-DQT_THREAD_SUPPORT', '-D_REENTRANT'] ) + if not 'nohelp' in _flags: + if lenv['_CONFIGURE'] or lenv['HELP']: + env.Exit(0) + + ## To use kdDebug(intvalue)<<"some trace"< - -""" -Run scons -h to display the associated help, or look below .. -""" - -BOLD ="\033[1m" -RED ="\033[91m" -GREEN ="\033[92m" -YELLOW ="\033[1m" #"\033[93m" # unreadable on white backgrounds -CYAN ="\033[96m" -NORMAL ="\033[0m" - -import os, re, types - -# Returns the name of the shared object (i.e. libtdeui.so.4) -# referenced by a libtool archive (like libtdeui.la) -def getSOfromLA(lafile): - contents = open(lafile, 'r').read() - match = re.search("^dlname='([^']*)'$", contents, re.M) - if match: - return match.group(1) - return None - -def exists(env): - return True - -def detect_kde(env): - """ Detect the qt and kde environment using tde-config mostly """ - - prefix = env['ARGS'].get('prefix', None) - execprefix = env['ARGS'].get('execprefix', None) - datadir = env['ARGS'].get('datadir', None) - libdir = env['ARGS'].get('libdir', None) - libsuffix = env['ARGS'].get('libsuffix', '') - kdeincludes = env['ARGS'].get('kdeincludes', None) - tdelibs = env['ARGS'].get('tdelibs', None) - qtincludes = env['ARGS'].get('qtincludes', None) - qtlibs = env['ARGS'].get('qtlibs', None) - - if libdir: - libdir = libdir+libsuffix - - ## Detect the kde libraries - print "Checking for tde-config : ", - kde_config = os.popen("which tde-config 2>/dev/null").read().strip() - if len(kde_config): - print GREEN+"tde-config was found"+NORMAL - else: - print RED+"tde-config was NOT found in your PATH"+NORMAL - print "Make sure kde is installed properly" - print "(missing package tdebase-devel?)" - env.Exit(1) - env['TDEDIR'] = os.popen('tde-config -prefix').read().strip() - - print "Checking for kde version : ", - kde_version = os.popen("tde-config --version|grep KDE").read().strip().split()[1] - if int(kde_version[0]) != 3 or int(kde_version[2]) < 2: - print RED+kde_version - print RED+"Your kde version can be too old"+NORMAL - print RED+"Please make sure kde is at least 3.2"+NORMAL - else: - print GREEN+kde_version+NORMAL - - ## Detect the qt library - print "Checking for the qt library : ", - qtdir = os.getenv("QTDIR") - if qtdir: - print GREEN+"qt is in "+qtdir+NORMAL - else: - libdir = os.popen('tde-config --expandvars --install lib').read().strip() - libtdeuiSO = libdir+'/'+getSOfromLA(libdir+'/libtdeui.la') - m = re.search('(.*)/lib/libqt.*', os.popen('ldd ' + libtdeuiSO + ' | grep libqt').read().strip().split()[2]) - if m: - qtdir = m.group(1) - print YELLOW+"qt was found as "+m.group(1)+NORMAL - else: - print RED+"qt was not found"+NORMAL - print RED+"Please set QTDIR first (/usr/lib/qt3?)"+NORMAL - env.Exit(1) - env['QTDIR'] = qtdir.strip() - - ## Find the necessary programs uic and moc - print "Checking for uic : ", - uic = qtdir + "/bin/uic" - if os.path.isfile(uic): - print GREEN+"uic was found as "+uic+NORMAL - else: - uic = os.popen("which uic 2>/dev/null").read().strip() - if len(uic): - print YELLOW+"uic was found as "+uic+NORMAL - else: - uic = os.popen("which uic 2>/dev/null").read().strip() - if len(uic): - print YELLOW+"uic was found as "+uic+NORMAL - else: - print RED+"uic was not found - set QTDIR put it in your PATH ?"+NORMAL - env.Exit(1) - env['QT_UIC'] = uic - - print "Checking for moc : ", - moc = qtdir + "/bin/moc" - if os.path.isfile(moc): - print GREEN + "moc was found as " + moc + NORMAL - else: - moc = os.popen("which moc 2>/dev/null").read().strip() - if len(moc): - print YELLOW + "moc was found as " + moc + NORMAL - elif os.path.isfile("/usr/share/qt3/bin/moc"): - moc = "/usr/share/qt3/bin/moc" - print YELLOW + "moc was found as " + moc + NORMAL - else: - print RED + "moc was not found - set QTDIR or put it in your PATH ?" + NORMAL - env.Exit(1) - env['QT_MOC'] = moc - - ## check for the qt and kde includes - print "Checking for the qt includes : ", - if qtincludes and os.path.isfile(qtincludes + "/qtqlayout.h"): - # The user told where to look for and it looks valid - print GREEN + "ok " + qtincludes + NORMAL - else: - if os.path.isfile(qtdir + "/include/qtqlayout.h"): - # Automatic detection - print GREEN + "ok " + qtdir + "/include/ " + NORMAL - qtincludes = qtdir + "/include/" - elif os.path.isfile("/usr/include/qt3/qtqlayout.h"): - # Debian probably - print YELLOW + "the qt headers were found in /usr/include/qt3/ " + NORMAL - qtincludes = "/usr/include/qt3" - else: - print RED + "the qt headers were not found" + NORMAL - env.Exit(1) - - print "Checking for the kde includes : ", - kdeprefix = os.popen("tde-config --prefix").read().strip() - if not kdeincludes: - kdeincludes = kdeprefix+"/include/" - if os.path.isfile(kdeincludes + "/klineedit.h"): - print GREEN + "ok " + kdeincludes + NORMAL - else: - if os.path.isfile(kdeprefix+"/include/tde/klineedit.h"): - # Debian, Fedora probably - print YELLOW + "the kde headers were found in " + kdeprefix + "/include/tde/" + NORMAL - kdeincludes = kdeprefix + "/include/tde/" - else: - print RED + "The kde includes were NOT found" + NORMAL - env.Exit(1) - - if prefix: - ## use the user-specified prefix - if not execprefix: - execprefix = prefix - if not datadir: - datadir=prefix+"/share" - if not libdir: - libdir=execprefix+"/lib"+libsuffix - - subst_vars = lambda x: x.replace('${exec_prefix}', execprefix).replace('${datadir}',datadir).replace('${libdir}', libdir) - debian_fix = lambda x: x.replace('/usr/share', '${datadir}') - env['KDEBIN'] = subst_vars(os.popen('tde-config --install exe').read().strip()) - env['KDEAPPS'] = subst_vars(os.popen('tde-config --install apps').read().strip()) - env['KDEDATA'] = subst_vars(os.popen('tde-config --install data').read().strip()) - env['KDEMODULE']= subst_vars(os.popen('tde-config --install module').read().strip()) - env['KDELOCALE']= subst_vars(os.popen('tde-config --install locale').read().strip()) - env['KDEDOC'] = subst_vars( debian_fix(os.popen('tde-config --install html').read().strip()) ) - env['KDEKCFG'] = subst_vars(os.popen('tde-config --install kcfg').read().strip()) - env['KDEXDG'] = subst_vars(os.popen('tde-config --install xdgdata-apps').read().strip()) - env['KDEXDGDIR']= subst_vars(os.popen('tde-config --install xdgdata-dirs').read().strip()) - env['KDEMENU'] = subst_vars(os.popen('tde-config --install apps').read().strip()) - env['KDEMIME'] = subst_vars(os.popen('tde-config --install mime').read().strip()) - env['KDEICONS'] = subst_vars(os.popen('tde-config --install icon').read().strip()) - env['KDESERV'] = subst_vars(os.popen('tde-config --install services').read().strip()) - else: - # the user has given no prefix, install as a normal kde app - env['PREFIX'] = os.popen('tde-config --prefix').read().strip() - env['KDEBIN'] = os.popen('tde-config --expandvars --install exe').read().strip() - env['KDEAPPS'] = os.popen('tde-config --expandvars --install apps').read().strip() - env['KDEDATA'] = os.popen('tde-config --expandvars --install data').read().strip() - env['KDEMODULE']= os.popen('tde-config --expandvars --install module').read().strip() - env['KDELOCALE']= os.popen('tde-config --expandvars --install locale').read().strip() - env['KDEDOC'] = os.popen('tde-config --expandvars --install html').read().strip() - env['KDEKCFG'] = os.popen('tde-config --expandvars --install kcfg').read().strip() - env['KDEXDG'] = os.popen('tde-config --expandvars --install xdgdata-apps').read().strip() - env['KDEXDGDIR']= os.popen('tde-config --expandvars --install xdgdata-dirs').read().strip() - env['KDEMENU'] = os.popen('tde-config --expandvars --install apps').read().strip() - env['KDEMIME'] = os.popen('tde-config --expandvars --install mime').read().strip() - env['KDEICONS'] = os.popen('tde-config --expandvars --install icon').read().strip() - env['KDESERV'] = os.popen('tde-config --expandvars --install services').read().strip() - - env['QTPLUGINS']=os.popen('tde-config --expandvars --install qtplugins').read().strip() - - ## kde libs and includes - env['KDEINCLUDEPATH']=kdeincludes - if not tdelibs: - tdelibs=os.popen('tde-config --expandvars --install lib').read().strip() - env['KDELIBPATH']=tdelibs - - ## qt libs and includes - env['QTINCLUDEPATH']=qtincludes - if not qtlibs: - qtlibs=qtdir+"/lib" - env['QTLIBPATH']=qtlibs - -def generate(env): - """"Set up the qt and kde environment and builders - the moc part is difficult to understand """ - if env['HELP']: - print """ -"""+BOLD+"""*** KDE options *** --------------------"""+NORMAL+""" -"""+BOLD+"""* prefix """+NORMAL+""": base install path, ie: /usr/local -"""+BOLD+"""* execprefix """+NORMAL+""": install path for binaries, ie: /usr/bin -"""+BOLD+"""* datadir """+NORMAL+""": install path for the data, ie: /usr/local/share -"""+BOLD+"""* libdir """+NORMAL+""": install path for the libs, ie: /usr/lib -"""+BOLD+"""* libsuffix """+NORMAL+""": suffix of libraries on amd64, ie: 64, 32 -"""+BOLD+"""* kdeincludes"""+NORMAL+""": path to the kde includes (/usr/include/tde on debian, ...) -"""+BOLD+"""* qtincludes """+NORMAL+""": same punishment, for qt includes (/usr/include/qt on debian, ...) -"""+BOLD+"""* tdelibs """+NORMAL+""": path to the kde libs, for linking the programs -"""+BOLD+"""* qtlibs """+NORMAL+""": same punishment, for qt libraries -ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt -"""+NORMAL - - import SCons.Defaults - import SCons.Tool - import SCons.Util - - ui_extensions = [".ui"] - header_extensions = [".h", ".hxx", ".hpp", ".hh"] - source_extensions = [".cpp", ".cxx", ".cc"] - - def find_file(filename, paths, node_factory): - retval = None - for dir in paths: - node = node_factory(filename, dir) - if node.rexists(): - return node - return None - - class _Metasources: - """ Callable class, which works as an emitter for Programs, SharedLibraries - and StaticLibraries.""" - - def __init__(self, objBuilderName): - self.objBuilderName = objBuilderName - - def __call__(self, target, source, env): - """ Smart autoscan function. Gets the list of objects for the Program - or Lib. Adds objects and builders for the special qt files. """ - try: - if int(env.subst('$QT_AUTOSCAN')) == 0: - return target, source - except ValueError: - pass - - try: - qtdebug = int(env.subst('$QT_DEBUG')) - except ValueError: - qtdebug = 0 - - # some shortcuts used in the scanner - FS = SCons.Node.FS.default_fs - splitext = SCons.Util.splitext - objBuilder = getattr(env, self.objBuilderName) - - # some regular expressions: - # Q_OBJECT detection - q_object_search = re.compile(r'[^A-Za-z0-9]Q_OBJECT[^A-Za-z0-9]') - - # The following is kind of hacky to get builders working properly (FIXME) ?? - objBuilderEnv = objBuilder.env - objBuilder.env = env - mocBuilderEnv = env.Moc.env - env.Moc.env = env - - # make a deep copy for the result; MocH objects will be appended - out_sources = source[:] - - for obj in source: - if not obj.has_builder(): - # binary obj file provided - if qtdebug: - print "scons: qt: '%s' seems to be a binary. Discarded." % str(obj) - continue - cpp = obj.sources[0] - if not splitext(str(cpp))[1] in source_extensions: - if qtdebug: - print "scons: qt: '%s' is no cxx file. Discarded." % str(cpp) - # c or fortran source - continue - #cpp_contents = comment.sub('', cpp.get_contents()) - cpp_contents = cpp.get_contents() - - h = None - ui = None - - for ui_ext in ui_extensions: - # try to find the ui file in the corresponding source directory - uiname = splitext(cpp.name)[0] + ui_ext - ui = find_file(uiname, (cpp.get_dir(),), FS.File) - if ui: - if qtdebug: - print "scons: qt: found .ui file of header" #% (str(h), str(cpp)) - #h_contents = comment.sub('', h.get_contents()) - break - - # if we have a .ui file, do not continue, it is automatically handled by Uic - if ui: - continue - - for h_ext in header_extensions: - # try to find the header file in the corresponding source - # directory - hname = splitext(cpp.name)[0] + h_ext - h = find_file(hname, (cpp.get_dir(),), FS.File) - if h: - if qtdebug: - print "scons: qt: Scanning '%s' (header of '%s')" % (str(h), str(cpp)) - #h_contents = comment.sub('', h.get_contents()) - h_contents = h.get_contents() - break - - if not h and qtdebug: - print "scons: qt: no header for '%s'." % (str(cpp)) - if h and q_object_search.search(h_contents): - # h file with the Q_OBJECT macro found -> add .moc or _moc.cpp file - moc_cpp = None - - if env.has_key('NOMOCSCAN'): - moc_cpp = env.Moc(h) - else: - reg = '\n\s*#include\s*("|<)'+splitext(cpp.name)[0]+'.moc("|>)' - meta_object_search = re.compile(reg) - if meta_object_search.search(cpp_contents): - moc_cpp = env.Moc(h) - else: - moc_cpp = env.Moccpp(h) - moc_o = objBuilder(moc_cpp) - out_sources.append(moc_o) - if qtdebug: - print "scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(moc_cpp[0])) - - if cpp and q_object_search.search(cpp_contents): - print "error, bksys cannot handle cpp files with Q_OBJECT classes" - print "if you are sure this is a feature worth the effort, " - print "report this to the authors tnagyemail-mail yahoo.fr" - - # restore the original env attributes (FIXME) - objBuilder.env = objBuilderEnv - env.Moc.env = mocBuilderEnv - - return (target, out_sources) - - MetasourcesShared = _Metasources('SharedObject') - MetasourcesStatic = _Metasources('StaticObject') - - CLVar = SCons.Util.CLVar - splitext = SCons.Util.splitext - Builder = SCons.Builder.Builder - - # Detect the environment - replaces ./configure implicitely and store the options into a cache - from SCons.Options import Options - cachefile=env['CACHEDIR']+'kde.cache.py' - opts = Options(cachefile) - opts.AddOptions( - ('PREFIX', 'root of the program installation'), - - ('QTDIR', 'root of qt directory'), - ('QTLIBPATH', 'path to the qt libraries'), - ('QTINCLUDEPATH', 'path to the qt includes'), - ('QT_UIC', 'moc directory'), - ('QT_MOC', 'moc executable command'), - ('QTPLUGINS', 'uic executable command'), - ('TDEDIR', 'root of kde directory'), - ('KDELIBPATH', 'path to the kde libs'), - ('KDEINCLUDEPATH', 'path to the kde includes'), - - ('KDEBIN', 'installation path of the kde binaries'), - ('KDEMODULE', 'installation path of the parts and libs'), - ('KDEAPPS', ''), - ('KDEDATA', 'installation path of the application data'), - ('KDELOCALE', ''), - ('KDEDOC', 'installation path of the application documentation'), - ('KDEKCFG', 'installation path of the .kcfg files'), - ('KDEXDG', 'installation path of the service types'), - ('KDEXDGDIR', 'installation path of the xdg service directories'), - ('KDEMENU', ''), - ('KDEMIME', 'installation path of to the mimetypes'), - ('KDEICONS', ''), - ('KDESERV', ''), - ) - opts.Update(env) - - # reconfigure when things are missing - if not env['HELP'] and (env['_CONFIGURE'] or not env.has_key('QTDIR') or not env.has_key('TDEDIR')): - detect_kde(env) - - # finally save the configuration to the cache file - opts.Save(cachefile, env) - - ## set default variables, one can override them in sconscript files - env.Append(CXXFLAGS = ['-I'+env['KDEINCLUDEPATH'], '-I'+env['QTINCLUDEPATH'] ]) - env.Append(LIBPATH = [env['KDELIBPATH'], env['QTLIBPATH'] ]) - - env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 - - env['QT_AUTOSCAN'] = 1 - env['QT_DEBUG'] = 0 - env['QT_UIC_HFLAGS'] = '-L $QTPLUGINS -nounload' - env['QT_UIC_CFLAGS'] = '$QT_UIC_HFLAGS -tr tr2i18n' - env['QT_LIBS'] = 'qt-mt' - env['QT_UICIMPLPREFIX'] = '' - env['QT_UICIMPLSUFFIX'] = '.cpp' - - env['QT_MOCHPREFIX'] = '' - env['QT_MOCHSUFFIX'] = '.moc' - env['KDE_KCFG_IMPLPREFIX'] = '' - env['KDE_KCFG_IMPL_HSUFFIX'] = '.h' - env['KDE_KCFG_IMPL_CSUFFIX'] = '.cpp' - env['KDE_SKEL_IMPL_SUFFIX'] = '.skel' - env['MEINPROC'] = 'meinproc' - env['MSGFMT'] = 'msgfmt' - - ## ui file processing - def uic_processing(target, source, env): - inc_kde = '#include \n#include \n' - inc_moc = '#include "%s"\n' % target[2].name - comp_h = '$QT_UIC $QT_UIC_HFLAGS -o %s %s' % (target[0].path, source[0].path) - comp_c = '$QT_UIC $QT_UIC_CFLAGS -impl %s %s' % (target[0].path, source[0].path) - comp_moc = '$QT_MOC -o %s %s' % (target[2].path, target[0].path) - - ret = env.Execute(comp_h) - if ret: - return ret - - dest = open( target[1].path, "w" ) - dest.write(inc_kde) - dest.close() - - ret = env.Execute( comp_c+" >> "+target[1].path ) - if ret: - return ret - - dest = open( target[1].path, "a" ) - dest.write(inc_moc) - dest.close() - - ret = env.Execute( comp_moc ) - return ret - - def uicEmitter(target, source, env): - adjustixes = SCons.Util.adjustixes - bs = SCons.Util.splitext(str(source[0].name))[0] - bs = os.path.join(str(target[0].get_dir()),bs) - # first target is automatically added by builder (.h file) - if len(target) < 2: - # second target is .cpp file - target.append(adjustixes(bs, - env.subst('$QT_UICIMPLPREFIX'), - env.subst('$QT_UICIMPLSUFFIX'))) - if len(target) < 3: - # third target is .moc file - target.append(adjustixes(bs, - env.subst('$QT_MOCHPREFIX'), - env.subst('$QT_MOCHSUFFIX'))) - return target, source - - UIC_BUILDER = Builder( - action = uic_processing, - emitter = uicEmitter, - suffix = '.h', - src_suffix = '.ui') - - ## moc file processing - env['QT_MOCCOM'] = ('$QT_MOC -o ${TARGETS[0]} $SOURCE') - - MOC_BUILDER = Builder( - action = '$QT_MOCCOM', - suffix = '.moc', - src_suffix = '.h') - - MOCCPP_BUILDER = Builder( - action = '$QT_MOCCOM', - suffix = '_moc.cpp', - src_suffix = '.h') - - ## kcfg file processing - def kcfgGenerator(target, source, env, for_signature): - act=[] - act.append('tdeconfig_compiler -d'+str(source[0].get_dir())+' '+source[1].path+' '+source[0].path) - return act - - def kcfgEmitter(target, source, env): - adjustixes = SCons.Util.adjustixes - bs = SCons.Util.splitext(str(source[0].name))[0] - bs = os.path.join(str(target[0].get_dir()),bs) - # .h file is automatically added - if len(target) < 2: - # add .cpp file - target.append(adjustixes(bs, env.subst('$KDE_KCFG_IMPLPREFIX'), env.subst('$KDE_KCFG_IMPL_CSUFFIX'))) - - if len(source) <2: - if not os.path.isfile(str(source[0])): - print RED+'kcfg file given'+str(source[0])+' does not exist !'+NORMAL - return target, source - kfcgfilename="" - kcfgFileDeclRx = re.compile("^[fF]ile\s*=\s*(.+)\s*$") - for line in file(str(source[0]), "r").readlines(): - match = kcfgFileDeclRx.match(line.strip()) - if match: - kcfgfilename = match.group(1) - break - source.append(str(source[0].get_dir())+'/'+kcfgfilename) - return target, source - - KCFG_BUILDER = Builder( - generator = kcfgGenerator, - emitter = kcfgEmitter, - suffix = '.h', - src_suffix = '.kcfgc') - - ## dcop processing - def dcopGenerator(target, source, env, for_signature): - act=[] - act.append('dcopidl '+source[0].path+' > '+target[1].path+'|| ( rm -f '+target[1].path+' ; false)') - act.append('dcopidl2cpp --c++-suffix cpp --no-Q_SIGNALS --no-stub '+target[1].path) - return act - - def dcopEmitter(target, source, env): - bs = SCons.Util.splitext(str(source[0].name))[0] - bs = os.path.join(str(target[0].get_dir()),bs) - target.append(bs+'.kidl') - #target.append(bs+'_skel.cpp') - return target, source - - DCOP_BUILDER = Builder( - generator = dcopGenerator, - emitter = dcopEmitter, - suffix = '_skel.cpp', - src_suffix = '.h') - - ## documentation processing - MEINPROC_BUILDER = Builder( - action = '$MEINPROC --check --cache $TARGET $SOURCE', - suffix = '.cache.bz2') - - ## translation files builder - TRANSFILES_BUILDER = Builder( - action = '$MSGFMT $SOURCE -o $TARGET', - suffix = '.gmo', - src_suffix = '.po') - - ## libtool file builder - def la_file(target, source, env): - dest=open(target[0].path, 'w') - sname=source[0].name - dest.write("dlname='%s'\n" % sname) - dest.write("library_names='%s %s %s'\n" % (sname, sname, sname)) - dest.write("old_library=''\n") - dest.write("dependency_libs=''\n") - dest.write("current=0\n") - dest.write("age=0\n") - dest.write("revision=0\n") - dest.write("installed=yes\n") - dest.write("shouldnotlink=no\n") - dest.write("dlopen=''\n") - dest.write("dlpreopen=''\n") - dest.write("libdir='%s'" % env['KDEMODULE']) - dest.close() - return 0 - - LA_BUILDER = Builder( - action = la_file, - suffix = '.la', - src_suffix = env['SHLIBSUFFIX']) - - ## register the builders - env['BUILDERS']['Uic'] = UIC_BUILDER - env['BUILDERS']['Moc'] = MOC_BUILDER - env['BUILDERS']['Moccpp'] = MOCCPP_BUILDER - env['BUILDERS']['Dcop'] = DCOP_BUILDER - env['BUILDERS']['Kcfg'] = KCFG_BUILDER - env['BUILDERS']['LaFile'] = LA_BUILDER - env['BUILDERS']['Meinproc'] = MEINPROC_BUILDER - env['BUILDERS']['Transfiles']= TRANSFILES_BUILDER - - static_obj, shared_obj = SCons.Tool.createObjBuilders(env) - static_obj.src_builder.append('Uic') - shared_obj.src_builder.append('Uic') - static_obj.src_builder.append('Kcfg') - shared_obj.src_builder.append('Kcfg') - static_obj.src_builder.append('LaFile') - shared_obj.src_builder.append('LaFile') - static_obj.src_builder.append('Meinproc') - shared_obj.src_builder.append('Meinproc') - static_obj.src_builder.append('Transfiles') - shared_obj.src_builder.append('Transfiles') - - ## Find the files to moc, dcop, and link against kde and qt - env.AppendUnique(PROGEMITTER = [MetasourcesStatic], SHLIBEMITTER=[MetasourcesShared], LIBEMITTER =[MetasourcesStatic]) - - ## Handy helpers for building kde programs - ## You should not have to modify them .. - - ## return a list of things - def make_list(e): - if type(e) is types.ListType: - return e - else: - return e.split() - - #import SCons.Util - skel_ext = [".skel", ".SKEL"] - def KDEfiles(lenv, target, source): - """ Returns a list of files for scons (handles kde tricks like .skel) - It also makes custom checks against double includes like : ['file.ui', 'file.cpp'] - (file.cpp is already included because of file.ui) """ - - src=[] - ui_files=[] - kcfg_files=[] - skel_files=[] - other_files=[] - - source_=make_list(source) - - # For each file, check wether it is a dcop file or not, and create the complete list of sources - for file in source_: - bs = SCons.Util.splitext(file)[0] - ext = SCons.Util.splitext(file)[1] - if ext in skel_ext: - lenv.Dcop(bs+'.h') - src.append(bs+'_skel.cpp') - elif ext == ".moch": - lenv.Moccpp(bs+'.h') - src.append(bs+'_moc.cpp') - else: - src.append(file) - - if ext == '.ui': - ui_files.append(bs) - elif ext == '.kcfgc': - kcfg_files.append(bs) - elif ext == '.skel': - skel_files.append(bs) - else: - other_files.append(bs) - - # Now check against typical newbie errors - for file in ui_files: - for ofile in other_files: - if ofile == file: - print RED+"WARNING: You have included "+file+".ui and another file of the same prefix"+NORMAL - print "Files generated by uic (file.h, file.cpp must not be included" - for file in kcfg_files: - for ofile in other_files: - if ofile == file: - print RED+"WARNING: You have included "+file+".kcfg and another file of the same prefix"+NORMAL - print "Files generated by tdeconfig_compiler (settings.h, settings.cpp) must not be included" - return src - - - """ - In the future, these functions will contain the code that will dump the - configuration for re-use from an IDE - """ - import glob - def KDEinstall(lenv, restype, subdir, files): - if not env['_INSTALL']: - return - basedir=env['DESTDIR'] - if len(restype)>0: - if not lenv.has_key(restype): - print RED+"unknown resource type "+restype+NORMAL - else: - basedir += lenv[restype]+'/' - #print file # <- useful to trace stuff :) - install_list = env.Install(basedir+subdir+'/', files) - env.Alias('install', install_list) - return install_list - - def KDEinstallas(lenv, restype, destfile, file): - if not env['_INSTALL']: - return - basedir=env['DESTDIR'] - if len(restype)>0: - if not lenv.has_key(restype): - print RED+"unknown resource type "+restype+NORMAL - else: - basedir += lenv[restype]+'/' - install_list = env.InstallAs(basedir+destfile, file) - env.Alias('install', install_list) - return install_list - - def KDEprogram(lenv, target, source): - """ Makes a kde program - The program is installed except if one sets env['NOAUTOINSTALL'] """ - src = KDEfiles(lenv, target, source) - program_list = lenv.Program(target, src) - if not lenv.has_key('NOAUTOINSTALL'): - KDEinstall(lenv, 'KDEBIN', '', target) - return program_list - - def KDEshlib(lenv, target, source, kdelib=0, libprefix='lib'): - """ Makes a shared library for kde (.la file for klibloader) - The library is installed except if one sets env['NOAUTOINSTALL'] """ - src = KDEfiles(lenv, target, source) - lenv['LIBPREFIX']=libprefix - library_list = lenv.SharedLibrary(target, src) - lafile_list = lenv.LaFile(target, library_list) - if not lenv.has_key('NOAUTOINSTALL'): - install_dir = 'KDEMODULE' - if kdelib==1: - install_dir = 'KDELIBPATH' - KDEinstall(lenv, install_dir, '', library_list) - KDEinstall(lenv, install_dir, '', lafile_list) - return library_list - - def KDEstaticlib(lenv, target, source): - """ Makes a static library for kde - in practice you should not use static libraries - 1. they take more memory than shared ones - 2. makefile.am needed it because of limitations - (cannot handle sources in separate folders - takes extra processing) """ - src = KDEfiles(lenv, target, source) - return lenv.StaticLibrary(target, src) - # do not install static libraries by default - - def KDEaddflags_cxx(lenv, fl): - """ Compilation flags for C++ programs """ - lenv.AppendUnique(CXXFLAGS = make_list(fl)) - - def KDEaddflags_c(lenv, fl): - """ Compilation flags for C programs """ - lenv.AppendUnique(CFLAGS = make_list(fl)) - - def KDEaddflags_link(lenv, fl): - """ Add link flags - Use this if KDEaddlibs below is not enough """ - lenv.AppendUnique(LINKFLAGS = make_list(fl)) - - def KDEaddlibs(lenv, libs): - """ Helper function """ - lenv.AppendUnique(LIBS = make_list(libs)) - - def KDEaddpaths_includes(lenv, paths): - """ Add new include paths """ - lenv.AppendUnique(CPPPATH = make_list(paths)) - - def KDEaddpaths_libs(lenv, paths): - """ Add paths to libraries """ - lenv.AppendUnique(LIBPATH = make_list(paths)) - - def KDElang(lenv, folder, appname): - """ Process translations (.po files) in a po/ dir """ - transfiles = glob.glob(folder+'/*.po') - for lang in transfiles: - result = lenv.Transfiles(lang) - country = SCons.Util.splitext(result[0].name)[0] - KDEinstallas(lenv, 'KDELOCALE', country+'/LC_MESSAGES/'+appname+'.mo', result) - - def subdirs(lenv, folderlist): - flist=make_list(folderlist) - for i in flist: - lenv.SConscript(i+"/SConscript") - - def KDEicon(lenv, icname='*', path='./'): - """ Emulates the behaviour of Makefile.am to install icons - Contributed by: "Andrey Golovizin" """ - type_dic = { 'action' : 'actions', 'app' : 'apps', 'device' : - 'devices', 'filesys' : 'filesystems', 'mime' : 'mimetypes' } - dir_dic = { - 'los' :'locolor/16x16', - 'lom' :'locolor/32x32', - 'him' :'hicolor/32x32', - 'hil' :'hicolor/48x48', - 'lo16' :'locolor/16x16', - 'lo22' :'locolor/22x22', - 'lo32' :'locolor/32x32', - 'hi16' :'hicolor/16x16', - 'hi22' :'hicolor/22x22', - 'hi32' :'hicolor/32x32', - 'hi48' :'hicolor/48x48', - 'hi64' :'hicolor/64x64', - 'hi128':'hicolor/128x128', - 'hisc' :'hicolor/scalable', - 'cr16' :'crystalsvg/16x16', - 'cr22' :'crystalsvg/22x22', - 'cr32' :'crystalsvg/32x32', - 'cr48' :'crystalsvg/48x48', - 'cr64' :'crystalsvg/64x64', - 'cr128':'crystalsvg/128x128', - 'crsc' :'crystalsvg/scalable' - } - - iconfiles = [] - for ext in "png xpm mng svg svgz".split(): - files = glob.glob(path+'/'+'*-*-%s.%s' % (icname, ext)) - iconfiles += files - for iconfile in iconfiles: - lst = iconfile.split('/') - filename = lst[ len(lst) - 1 ] - tmp = filename.split('-') - if len(tmp)!=3: - print RED+'WARNING: icon filename has unknown format: '+iconfile+NORMAL - continue - [icon_dir, icon_type, icon_filename]=tmp - try: - destfile = '%s/%s/%s/%s' % (lenv['KDEICONS'], dir_dic[icon_dir], type_dic[icon_type], icon_filename) - except KeyError: - print RED+'WARNING: unknown icon type: '+iconfile+NORMAL - continue - ## Do not use KDEinstallas here, as parsing from an ide will be necessary - if env['_INSTALL']: - env.Alias('install', env.InstallAs( env['DESTDIR']+'/'+destfile, iconfile ) ) - - def KDEuse(lenv, flags): - _flags=make_list(flags) - if 'environ' in _flags: - ## The scons developers advise against using this but it is mostly innocuous :) - import os - lenv.AppendUnique( ENV = os.environ ) - if not 'lang_qt' in _flags: - ## Use this define if you are using the kde translation scheme (.po files) - lenv.Append( CPPFLAGS = '-DQT_NO_TRANSLATION' ) - if 'rpath' in _flags: - ## Use this to set rpath - this may cause trouble if folders are moved (chrpath) - lenv.Append( RPATH = [env['QTLIBPATH'], env['KDELIBPATH'], env['KDEMODULE']] ) - if 'thread' in _flags: - ## Uncomment the following if you need threading support - lenv.KDEaddflags_cxx( ['-DQT_THREAD_SUPPORT', '-D_REENTRANT'] ) - if not 'nohelp' in _flags: - if lenv['_CONFIGURE'] or lenv['HELP']: - env.Exit(0) - - ## To use kdDebug(intvalue)<<"some trace"< acinclude.m4 - -MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files - -package-messages: - cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common package-messages - $(MAKE) -C po merge - -EXTRA_DIST = admin %{LICENSEFILE} configure.in.in - -dist-hook: - cd $(top_distdir) && perl admin/am_edit -padmin - cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs diff --git a/parts/appwizard/common/tde-Makefile.cvs b/parts/appwizard/common/tde-Makefile.cvs deleted file mode 100644 index 4c0afd1a..00000000 --- a/parts/appwizard/common/tde-Makefile.cvs +++ /dev/null @@ -1,10 +0,0 @@ -all: - @echo "This Makefile is only for the CVS repository" - @echo "This will be deleted before making the distribution" - @echo "" - $(MAKE) -f admin/Makefile.common cvs - -dist: - $(MAKE) -f admin/Makefile.common dist - -.SILENT: diff --git a/parts/appwizard/common/tde-app.lsm b/parts/appwizard/common/tde-app.lsm deleted file mode 100644 index 06055a96..00000000 --- a/parts/appwizard/common/tde-app.lsm +++ /dev/null @@ -1,14 +0,0 @@ -Begin4 -Title: $APPNAME -Version: R14.0.0 -Entered-date: 2010-05-10 -Description: .... for the Trinity Desktop Environment -Keywords: TDE Qt -Author: %{AUTHOR} <%{EMAIL}> -Maintained-by: The Trinity Desktop Environment (TDE) http://www.trinitydesktop.org/ -Primary-site: http://git.trinitydesktop.org/cgit/ -Alternate-site: -Original-site: -Platforms: Linux and other Unices running TDE -Copying-policy: GPL -End diff --git a/parts/appwizard/common/tde-doc-Makefile.am b/parts/appwizard/common/tde-doc-Makefile.am deleted file mode 100644 index a1f777a1..00000000 --- a/parts/appwizard/common/tde-doc-Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -# the SUBDIRS is filled automatically by am_edit. If files are -# in this directory they are installed into the english dir - -KDE_LANG = en -KDE_DOCS = %{APPNAMELC} -SUBDIRS = $(AUTODIRS) diff --git a/parts/appwizard/common/tde-doc-en-Makefile.am b/parts/appwizard/common/tde-doc-en-Makefile.am deleted file mode 100644 index bdd63b79..00000000 --- a/parts/appwizard/common/tde-doc-en-Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -KDE_DOCS = %{APPNAMELC} -KDE_LANG = en diff --git a/parts/appwizard/common/tde-po-Makefile.am b/parts/appwizard/common/tde-po-Makefile.am deleted file mode 100644 index 0fa209cd..00000000 --- a/parts/appwizard/common/tde-po-Makefile.am +++ /dev/null @@ -1 +0,0 @@ -POFILES = AUTO diff --git a/parts/appwizard/importdlg.cpp b/parts/appwizard/importdlg.cpp index 15f432b2..5f07f5b4 100644 --- a/parts/appwizard/importdlg.cpp +++ b/parts/appwizard/importdlg.cpp @@ -37,9 +37,9 @@ #include #include -#include "tdevcore.h" -#include "tdevversioncontrol.h" -#include "tdevplugincontroller.h" +#include "kdevcore.h" +#include "kdevversioncontrol.h" +#include "kdevplugincontroller.h" #include "domutil.h" #include "settings.h" @@ -272,7 +272,7 @@ void ImportDialog::dirChanged() // KDevelop legacy project? TQStringList files = dir.entryList("*.kdevprj"); if (!files.isEmpty()) { - scanLegacyTDevelopProject(dir.absFilePath(files.first())); + scanLegacyKDevelopProject(dir.absFilePath(files.first())); return; } @@ -328,7 +328,7 @@ void ImportDialog::dirChanged() } -void ImportDialog::scanLegacyTDevelopProject(const TQString &fileName) +void ImportDialog::scanLegacyKDevelopProject(const TQString &fileName) { kdDebug(9010) << "Scanning legacy KDevelop project file " << fileName << endl; @@ -524,7 +524,7 @@ void ImportDialog::slotFinishedCheckout( TQString destinationDir ) void ImportDialog::slotFetchModulesFromRepository() { - TDevVersionControl *vcs = m_part->versionControlByName( vcsCombo->currentText() ); + KDevVersionControl *vcs = m_part->versionControlByName( vcsCombo->currentText() ); if (!vcs) return; diff --git a/parts/appwizard/importdlg.h b/parts/appwizard/importdlg.h index af4d3859..5b334668 100644 --- a/parts/appwizard/importdlg.h +++ b/parts/appwizard/importdlg.h @@ -48,7 +48,7 @@ private slots: void slotProjectNameChanged( const TQString &_text ); private: // void scanAvailableVCS(); - void scanLegacyTDevelopProject(const TQString &fileName); + void scanLegacyKDevelopProject(const TQString &fileName); void scanLegacyStudioProject(const TQString &fileName); void scanAutomakeProject(const TQString &dirName); void setProjectType(const TQString &type); diff --git a/parts/appwizard/imports/CMakeLists.txt b/parts/appwizard/imports/CMakeLists.txt index d59750c4..e7b303c3 100644 --- a/parts/appwizard/imports/CMakeLists.txt +++ b/parts/appwizard/imports/CMakeLists.txt @@ -10,16 +10,16 @@ ################################################# install( FILES - c-auto cpp-auto fortran-auto java-auto tde gnome c cpp + c-auto cpp-auto fortran-auto java-auto kde gnome c cpp fortran python php perl java java-ant qttmake qtqmake qt4qmake ruby pascal ada - DESTINATION ${DATA_INSTALL_DIR}/tdevappwizard/imports ) + DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/imports ) install( FILES c-auto.tdevelop cpp-auto.tdevelop fortran-auto.tdevelop - java-auto.tdevelop tde.tdevelop gnome.tdevelop + java-auto.tdevelop kde.tdevelop gnome.tdevelop c.tdevelop cpp.tdevelop fortran.tdevelop python.tdevelop php.tdevelop perl.tdevelop java.tdevelop java-ant.tdevelop qttmake.tdevelop qtqmake.tdevelop qt4qmake.tdevelop ruby.tdevelop pascal.tdevelop ada.tdevelop - DESTINATION ${DATA_INSTALL_DIR}/tdevappwizard/importfiles ) + DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/importfiles ) diff --git a/parts/appwizard/imports/Makefile.am b/parts/appwizard/imports/Makefile.am index aaefd91f..c7f74dcd 100644 --- a/parts/appwizard/imports/Makefile.am +++ b/parts/appwizard/imports/Makefile.am @@ -1,7 +1,7 @@ -appwizarddatadir = ${kde_datadir}/tdevappwizard +appwizarddatadir = ${kde_datadir}/kdevappwizard importsdir = ${appwizarddatadir}/imports importfilesdir = ${appwizarddatadir}/importfiles -imports_DATA = c-auto cpp-auto fortran-auto java-auto tde gnome c cpp fortran python php perl java java-ant qttmake qtqmake qt4qmake ruby pascal ada -importfiles_DATA = c-auto.tdevelop cpp-auto.tdevelop fortran-auto.tdevelop java-auto.tdevelop tde.tdevelop gnome.tdevelop c.tdevelop cpp.tdevelop fortran.tdevelop python.tdevelop php.tdevelop perl.tdevelop java.tdevelop java-ant.tdevelop qttmake.tdevelop qtqmake.tdevelop qt4qmake.tdevelop ruby.tdevelop pascal.tdevelop ada.tdevelop +imports_DATA = c-auto cpp-auto fortran-auto java-auto kde gnome c cpp fortran python php perl java java-ant qttmake qtqmake qt4qmake ruby pascal ada +importfiles_DATA = c-auto.tdevelop cpp-auto.tdevelop fortran-auto.tdevelop java-auto.tdevelop kde.tdevelop gnome.tdevelop c.tdevelop cpp.tdevelop fortran.tdevelop python.tdevelop php.tdevelop perl.tdevelop java.tdevelop java-ant.tdevelop qttmake.tdevelop qtqmake.tdevelop qt4qmake.tdevelop ruby.tdevelop pascal.tdevelop ada.tdevelop diff --git a/parts/appwizard/imports/ada.tdevelop b/parts/appwizard/imports/ada.tdevelop index 188fbea6..cdb35b40 100644 --- a/parts/appwizard/imports/ada.tdevelop +++ b/parts/appwizard/imports/ada.tdevelop @@ -11,12 +11,12 @@ Code - + true - - + + bash bash_bugs @@ -63,11 +63,11 @@ KDE Libraries (Doxygen) - - + + - + diff --git a/parts/appwizard/imports/c-auto.tdevelop b/parts/appwizard/imports/c-auto.tdevelop index 002e6e1d..892dd88d 100644 --- a/parts/appwizard/imports/c-auto.tdevelop +++ b/parts/appwizard/imports/c-auto.tdevelop @@ -9,7 +9,7 @@ - + debug @@ -32,13 +32,13 @@ -O0 -g3 - - + + libtool - - + + ada ada_bugs_gcc @@ -85,12 +85,12 @@ KDE Libraries (Doxygen) - - + + - + diff --git a/parts/appwizard/imports/c.tdevelop b/parts/appwizard/imports/c.tdevelop index e578fba4..e0c06089 100644 --- a/parts/appwizard/imports/c.tdevelop +++ b/parts/appwizard/imports/c.tdevelop @@ -4,21 +4,21 @@ %{AUTHOR} %{EMAIL} %{VERSION} - TDevCustomProject + KDevCustomProject C - + - - + + - - + + ada ada_bugs_gcc @@ -65,12 +65,12 @@ KDE Libraries (Doxygen) - - + + - + diff --git a/parts/appwizard/imports/cpp-auto.tdevelop b/parts/appwizard/imports/cpp-auto.tdevelop index 0a1b05b1..74de8db0 100644 --- a/parts/appwizard/imports/cpp-auto.tdevelop +++ b/parts/appwizard/imports/cpp-auto.tdevelop @@ -9,7 +9,7 @@ - + debug @@ -30,13 +30,13 @@ -O0 -g3 - - + + libtool - - + + ada ada_bugs_gcc @@ -81,13 +81,13 @@ KDE Libraries (Doxygen) - - + + - + diff --git a/parts/appwizard/imports/cpp.tdevelop b/parts/appwizard/imports/cpp.tdevelop index 3eade8de..b351de38 100644 --- a/parts/appwizard/imports/cpp.tdevelop +++ b/parts/appwizard/imports/cpp.tdevelop @@ -4,21 +4,21 @@ %{AUTHOR} %{EMAIL} %{VERSION} - TDevCustomProject + KDevCustomProject C++ - + - - + + - - + + ada ada_bugs_gcc @@ -63,13 +63,13 @@ KDE Libraries (Doxygen) - - + + - + diff --git a/parts/appwizard/imports/fortran-auto.tdevelop b/parts/appwizard/imports/fortran-auto.tdevelop index 4be630a6..8fdd5f89 100644 --- a/parts/appwizard/imports/fortran-auto.tdevelop +++ b/parts/appwizard/imports/fortran-auto.tdevelop @@ -9,7 +9,7 @@ - + ada ada_bugs_gcc @@ -57,15 +57,15 @@ KDE Libraries (Doxygen) - - + + libtool - - + + - + diff --git a/parts/appwizard/imports/fortran.tdevelop b/parts/appwizard/imports/fortran.tdevelop index e7141b4f..c852870e 100644 --- a/parts/appwizard/imports/fortran.tdevelop +++ b/parts/appwizard/imports/fortran.tdevelop @@ -4,16 +4,16 @@ %{AUTHOR} %{EMAIL} %{VERSION} - TDevCustomProject + KDevCustomProject Fortran77 - + - - + + ada ada_bugs_gcc @@ -61,15 +61,15 @@ KDE Libraries (Doxygen) - - + + - - + + - + diff --git a/parts/appwizard/imports/gnome.tdevelop b/parts/appwizard/imports/gnome.tdevelop index cad92fda..0b8c5c95 100644 --- a/parts/appwizard/imports/gnome.tdevelop +++ b/parts/appwizard/imports/gnome.tdevelop @@ -7,10 +7,10 @@ KDevAutoProject C - TDevJavaDebugger + KDevJavaDebugger - + debug @@ -31,8 +31,8 @@ -O0 -g3 - - + + @@ -40,8 +40,8 @@ - - + + ada ada_bugs_gcc @@ -85,16 +85,16 @@ KDE Libraries (Doxygen) - - + + libtool - - + + - + diff --git a/parts/appwizard/imports/java-ant.tdevelop b/parts/appwizard/imports/java-ant.tdevelop index 1d64dc64..a4db806b 100644 --- a/parts/appwizard/imports/java-ant.tdevelop +++ b/parts/appwizard/imports/java-ant.tdevelop @@ -7,15 +7,15 @@ KDevAntProject Java - TDevDebugger + KDevDebugger - + ant - - + + ada ada_bugs_gcc @@ -59,10 +59,10 @@ KDE Libraries (Doxygen) - - + + - + diff --git a/parts/appwizard/imports/java-auto.tdevelop b/parts/appwizard/imports/java-auto.tdevelop index f5de6138..9a42ec82 100644 --- a/parts/appwizard/imports/java-auto.tdevelop +++ b/parts/appwizard/imports/java-auto.tdevelop @@ -7,10 +7,10 @@ KDevAutoProject Java - TDevDebugger + KDevDebugger - + ada ada_bugs_gcc @@ -54,10 +54,10 @@ KDE Libraries (Doxygen) - - + + - + diff --git a/parts/appwizard/imports/java.tdevelop b/parts/appwizard/imports/java.tdevelop index f5de6138..9a42ec82 100644 --- a/parts/appwizard/imports/java.tdevelop +++ b/parts/appwizard/imports/java.tdevelop @@ -7,10 +7,10 @@ KDevAutoProject Java - TDevDebugger + KDevDebugger - + ada ada_bugs_gcc @@ -54,10 +54,10 @@ KDE Libraries (Doxygen) - - + + - + diff --git a/parts/appwizard/imports/kde b/parts/appwizard/imports/kde new file mode 100644 index 00000000..13614802 --- /dev/null +++ b/parts/appwizard/imports/kde @@ -0,0 +1,5 @@ +# KDE Config File +[General] +Comment=KDE C++ Application (Automake based) +Comment[fr]=Une application KDE (Makefiles bass sur Automake) + diff --git a/parts/appwizard/imports/kde.tdevelop b/parts/appwizard/imports/kde.tdevelop new file mode 100644 index 00000000..5bff727f --- /dev/null +++ b/parts/appwizard/imports/kde.tdevelop @@ -0,0 +1,73 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevTDEAutoProject + C++ + + Qt + KDE + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + diff --git a/parts/appwizard/imports/pascal.tdevelop b/parts/appwizard/imports/pascal.tdevelop index 7db5a9d8..551ac91e 100644 --- a/parts/appwizard/imports/pascal.tdevelop +++ b/parts/appwizard/imports/pascal.tdevelop @@ -11,12 +11,12 @@ Code - + true - - + + ada ada_bugs_gcc @@ -64,12 +64,12 @@ KDE Libraries (Doxygen) - - + + - + diff --git a/parts/appwizard/imports/perl.tdevelop b/parts/appwizard/imports/perl.tdevelop index 0b4f4fba..bbf18ee3 100644 --- a/parts/appwizard/imports/perl.tdevelop +++ b/parts/appwizard/imports/perl.tdevelop @@ -9,11 +9,11 @@ - + - - + + ada ada_bugs_gcc @@ -60,10 +60,10 @@ KDE Libraries (Doxygen) - - + + - + diff --git a/parts/appwizard/imports/php.tdevelop b/parts/appwizard/imports/php.tdevelop index 4135828b..64651d3b 100644 --- a/parts/appwizard/imports/php.tdevelop +++ b/parts/appwizard/imports/php.tdevelop @@ -11,11 +11,11 @@ KDevdistpart - + - - + + gtk kde @@ -23,15 +23,15 @@ python perl - - + + true true false - - + + ada ada_bugs_gcc @@ -75,10 +75,10 @@ KDE Libraries (Doxygen) - - + + - + diff --git a/parts/appwizard/imports/python.tdevelop b/parts/appwizard/imports/python.tdevelop index d85480b9..3c6ece1a 100644 --- a/parts/appwizard/imports/python.tdevelop +++ b/parts/appwizard/imports/python.tdevelop @@ -7,15 +7,15 @@ KDevScriptProject Python - TDevDebugger - TDevJavaDebugger + KDevDebugger + KDevJavaDebugger - + - - + + bash bash_bugs @@ -60,10 +60,10 @@ KDE Libraries (Doxygen) - - + + - + diff --git a/parts/appwizard/imports/qt-auto.tdevelop b/parts/appwizard/imports/qt-auto.tdevelop index a8ac37de..b4bba39e 100644 --- a/parts/appwizard/imports/qt-auto.tdevelop +++ b/parts/appwizard/imports/qt-auto.tdevelop @@ -10,7 +10,7 @@ Qt - + @@ -18,8 +18,8 @@ - - + + gtk gnustep @@ -27,17 +27,17 @@ php perl - - + + libtool - - + + - + diff --git a/parts/appwizard/imports/qt.tdevelop b/parts/appwizard/imports/qt.tdevelop index 713510e0..6b716a7b 100644 --- a/parts/appwizard/imports/qt.tdevelop +++ b/parts/appwizard/imports/qt.tdevelop @@ -4,13 +4,13 @@ %{AUTHOR} %{EMAIL} %{VERSION} - TDevCustomProject + KDevCustomProject C++ Qt - + @@ -18,21 +18,21 @@ - - + + - - + + - - + + - + diff --git a/parts/appwizard/imports/qt4qmake.tdevelop b/parts/appwizard/imports/qt4qmake.tdevelop index e211a470..3be6c94c 100644 --- a/parts/appwizard/imports/qt4qmake.tdevelop +++ b/parts/appwizard/imports/qt4qmake.tdevelop @@ -10,15 +10,15 @@ Qt - + - - + + bash bash_bugs @@ -55,26 +55,26 @@ KDE Libraries (Doxygen) - - + + - - + + 4 true 4 ExternalDesigner - - + + - + diff --git a/parts/appwizard/imports/qtqmake.tdevelop b/parts/appwizard/imports/qtqmake.tdevelop index 8a9d6b17..2e9b089a 100644 --- a/parts/appwizard/imports/qtqmake.tdevelop +++ b/parts/appwizard/imports/qtqmake.tdevelop @@ -10,15 +10,15 @@ Qt - + - - + + bash bash_bugs @@ -55,25 +55,25 @@ KDE Libraries (Doxygen) - - + + - - + + 3 true 3 KDevEmbeddedDesigner - - + + - + diff --git a/parts/appwizard/imports/qttmake.tdevelop b/parts/appwizard/imports/qttmake.tdevelop index 015f4278..713655b6 100644 --- a/parts/appwizard/imports/qttmake.tdevelop +++ b/parts/appwizard/imports/qttmake.tdevelop @@ -10,15 +10,15 @@ Qt - + - - + + bash bash_bugs @@ -58,17 +58,17 @@ KDE Libraries (Doxygen) - - + + - - + + - + diff --git a/parts/appwizard/imports/ruby.tdevelop b/parts/appwizard/imports/ruby.tdevelop index 0a29b0a7..90dbe34a 100644 --- a/parts/appwizard/imports/ruby.tdevelop +++ b/parts/appwizard/imports/ruby.tdevelop @@ -13,22 +13,22 @@ KDevDoxygen KDevdistpart KDevVisualBoyAdvance - TDevDebugger + KDevDebugger - + src *.rb *~ - - + + - - + + bash bash_bugs @@ -73,10 +73,10 @@ KDE Libraries (Doxygen) - - + + - + diff --git a/parts/appwizard/imports/tde b/parts/appwizard/imports/tde deleted file mode 100644 index 13614802..00000000 --- a/parts/appwizard/imports/tde +++ /dev/null @@ -1,5 +0,0 @@ -# KDE Config File -[General] -Comment=KDE C++ Application (Automake based) -Comment[fr]=Une application KDE (Makefiles bass sur Automake) - diff --git a/parts/appwizard/imports/tde.tdevelop b/parts/appwizard/imports/tde.tdevelop deleted file mode 100644 index fe54fadc..00000000 --- a/parts/appwizard/imports/tde.tdevelop +++ /dev/null @@ -1,73 +0,0 @@ - - - - %{AUTHOR} - %{EMAIL} - %{VERSION} - KDevTDEAutoProject - C++ - - Qt - KDE - - - - - - - - - - - - - - ada - ada_bugs_gcc - bash - bash_bugs - clanlib - fortran_bugs_gcc - gnome1 - gnustep - gtk - gtk_bugs - haskell - haskell_bugs_ghc - java_bugs_gcc - java_bugs_sun - opengl - pascal_bugs_fp - php - php_bugs - perl - perl_bugs - python - python_bugs - ruby - ruby_bugs - sdl - stl - sw - w3c-dom-level2-html - w3c-svg - w3c-uaag10 - wxwidgets_bugs - - - qmake User Guide - - - - - libtool - - - - - - - - - - diff --git a/parts/appwizard/kdevappwizard.desktop b/parts/appwizard/kdevappwizard.desktop new file mode 100644 index 00000000..fa9dd541 --- /dev/null +++ b/parts/appwizard/kdevappwizard.desktop @@ -0,0 +1,87 @@ +[Desktop Entry] +Type=Service +Exec=blubb +Comment=Application Wizard +Comment[br]=Skoazeller meziant +Comment[ca]=Assistent d'aplicacions +Comment[da]=Programguide +Comment[de]=Anwendungs-Assistent für TDevelop +Comment[el]=Μάγος εφαρμογής +Comment[es]=Asistente de aplicaciones +Comment[et]=Rakenduse nõustaja +Comment[eu]=Aplikazio morroia +Comment[fa]=جادوگر کاربرد +Comment[fr]=Assistant de création d'applications +Comment[ga]=Treoraí Feidhmchláir +Comment[gl]=Asistente de aplicación +Comment[hi]=अनुप्रयोग विज़ार्ड +Comment[hu]=Alkalmazásvarázsló +Comment[it]=Procedura guidata applicazione +Comment[ja]=アプリケーションウィザード +Comment[ms]=Wizard Aplikasi +Comment[nds]=Programm-Hölper +Comment[ne]=अनुप्रयोग विजार्ड +Comment[nl]=Toepassingassistent +Comment[pl]=Asystent tworzenia programu +Comment[pt]=Assistente de Aplicações +Comment[pt_BR]=Assistente de Aplicativo +Comment[ru]=Мастер создания приложений +Comment[sk]=Aplikačný sprievodca +Comment[sl]=Čarovnik za programe +Comment[sr]=Чаробњак за програме +Comment[sr@Latn]=Čarobnjak za programe +Comment[sv]=Programguide +Comment[ta]=பயன்பாட்டு வழிகாட்டி +Comment[tg]=Устои сохтани гузориш +Comment[tr]=Uygulama Sihirbazı +Comment[zh_CN]=应用程序向导 +Comment[zh_TW]=應用程式精靈 +Name=KDevAppWizard +Name[da]=TDevelop Programguide +Name[de]=Anwendungs-Assistent (TDevelop) +Name[hi]=के-डेव-एप-विज़ार्ड +Name[nds]=Programm-Hölper (TDevelop) +Name[pl]=KDevAsystentApli +Name[sk]=KDev aplikačný sprievodca +Name[sv]=TDevelop programguide +Name[zh_TW]=TDevelop 應用程式精靈 +GenericName=Application Wizard +GenericName[br]=Skoazeller meziant +GenericName[ca]=Assistent d'aplicacions +GenericName[da]=Programguide +GenericName[de]=Anwendungs-Assistent +GenericName[el]=Μάγος εφαρμογής +GenericName[es]=Asistente de aplicaciones +GenericName[et]=Rakenduse nõustaja +GenericName[eu]=Aplikazio morroia +GenericName[fa]=جادوگر کاربرد +GenericName[fr]=Assistant d'applications +GenericName[ga]=Treoraí Feidhmchláir +GenericName[gl]=Asistente de aplicación +GenericName[hi]=अनुप्रयोग विज़ार्ड +GenericName[hu]=Alkalmazásvarázsló +GenericName[it]=Procedura guidata applicazione +GenericName[ja]=アプリケーションウィザード +GenericName[ms]=Wizard Aplikasi +GenericName[nds]=Programm-Hölper +GenericName[ne]=अनुप्रयोग विजार्ड +GenericName[nl]=Toepassingassistent +GenericName[pl]=Asystent tworzenia programu +GenericName[pt]=Assistente de Aplicações +GenericName[pt_BR]=Assistente de Aplicativo +GenericName[ru]=Мастер создания приложений +GenericName[sk]=Aplikačný sprievodca +GenericName[sl]=Čarovnik za programe +GenericName[sr]=Чаробњак за програме +GenericName[sr@Latn]=Čarobnjak za programe +GenericName[sv]=Programguide +GenericName[ta]=பயன்பாடு வழிகாட்டி +GenericName[tg]=Устои сохтани гузориш +GenericName[tr]=Uygulama Sihirbazı +GenericName[zh_CN]=应用程序向导 +GenericName[zh_TW]=應用程式精靈 +ServiceTypes=TDevelop/Plugin +X-TDE-Library=libkdevappwizard +X-TDevelop-Scope=Core +X-TDevelop-Version=5 +X-TDevelop-Properties=ProjectCreation diff --git a/parts/appwizard/kdevappwizard.rc b/parts/appwizard/kdevappwizard.rc new file mode 100644 index 00000000..c86e0f44 --- /dev/null +++ b/parts/appwizard/kdevappwizard.rc @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/parts/appwizard/kdevfile.cpp b/parts/appwizard/kdevfile.cpp new file mode 100644 index 00000000..4edb62c7 --- /dev/null +++ b/parts/appwizard/kdevfile.cpp @@ -0,0 +1,59 @@ +/* This file is part of the KDE project + Copyright (C) 2004 Sascha Cunz + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#include "kdevfile.h" + +static struct MimeTypeMapping +{ + const char* szMimeType; + KDevFile::CommentingStyle commentStyle; +} mimeTypeMapping[] = { +{ "text/x-c++hdr", KDevFile::CPPStyle }, +{ "text/x-c++src", KDevFile::CPPStyle }, +{ "text/x-chdr", KDevFile::CStyle }, +{ "text/x-csrc", KDevFile::CStyle }, +{ "text/adasrc", KDevFile::AdaStyle }, +{ "text/x-pascal", KDevFile::PascalStyle }, +{ "text/x-perl", KDevFile::BashStyle }, +{ "text/xml", KDevFile::XMLStyle }, +{ "text/x-xslt", KDevFile::XMLStyle }, +{ "text/x-xslfo", KDevFile::XMLStyle }, +{ "text/html", KDevFile::XMLStyle }, +{ "text/docbook", KDevFile::XMLStyle }, +{ "application/x-php", KDevFile::CPPStyle }, +{ "application/x-shellscript",KDevFile::BashStyle }, +{ NULL, KDevFile::NoCommenting } +}; + +KDevFile::CommentingStyle KDevFile::commentingStyleFromMimeType( const TQString& mimeType ) +{ + int idx = 0; + while( mimeTypeMapping[idx].szMimeType ) + { + if( mimeType == mimeTypeMapping[idx].szMimeType ) + return mimeTypeMapping[idx].commentStyle; + idx++; + } + return KDevFile::NoCommenting; +} + +KDevFile::CommentingStyle KDevFile::commentingStyleFromMimeType( KMimeType::Ptr mimeType ) +{ + return commentingStyleFromMimeType( mimeType->name() ); +} + diff --git a/parts/appwizard/kdevfile.h b/parts/appwizard/kdevfile.h new file mode 100644 index 00000000..6b2e2699 --- /dev/null +++ b/parts/appwizard/kdevfile.h @@ -0,0 +1,57 @@ +/* This file is part of the KDE project + Copyright (C) 2004 Sascha Cunz + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +/** +@file kdevfile.h +File abstraction layer. +*/ +#ifndef KDEVFILE_H +#define KDEVFILE_H + +#include + +/** +File abstraction. +*/ +class KDevFile +{ +public: + /**Styles of comment-formats a source file can have.*/ + enum CommentingStyle + { + NoCommenting, //!< file seems to be unable to contain comments + CPPStyle, //!< C Style:
/* comment */
+ CStyle, //!< C++ Style:
// comment
+ AdaStyle, //!< Ada Style:
-- comment --
+ PascalStyle, //!< Pascal Style:
{  comment  }
+ BashStyle, //!< Shell Style:
#  comment
+ XMLStyle //!< XML Style:
+ }; + +public: + /**@return A commenting style for a given mime type. + @param mimeType A string which defines a mime type (like "text/x-c+++src").*/ + static CommentingStyle commentingStyleFromMimeType(const TQString& mimeType); + + /**@return A commenting style for a given mime type. + @param mimeType The mime type.*/ + static CommentingStyle commentingStyleFromMimeType( KMimeType::Ptr mimeType ); +}; + +#endif diff --git a/parts/appwizard/kdevlicense.cpp b/parts/appwizard/kdevlicense.cpp new file mode 100644 index 00000000..5e189422 --- /dev/null +++ b/parts/appwizard/kdevlicense.cpp @@ -0,0 +1,116 @@ +/* This file is part of the KDE project + Copyright (C) 2004 Sascha Cunz + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#include "kdevlicense.h" + +#include +#include +#include + +KDevLicense::KDevLicense( const TQString& name, const TQString& fileName ) + : m_name( name ) +{ + readFile( fileName ); +} + +void KDevLicense::readFile( const TQString& fileName ) +{ + TQFile f(fileName); + if (!f.open(IO_ReadOnly)) + return; + TQTextStream stream(&f); + TQString str; + enum { readingText, readingFiles } mode = readingText; + for(;;) + { + str = stream.readLine(); + if( str.isNull() ) + break; + if( str == "[FILES]" ) + mode = readingFiles; + else if( str == "[PREFIX]" ) + mode = readingText; + else if( mode == readingFiles ) + { + if( !str.isEmpty() ) + { + m_copyFiles.append( str ); + } + } else + m_rawLines.append( str ); + } + +} + +TQString KDevLicense::assemble( KDevFile::CommentingStyle commentingStyle, const TQString& author, const TQString& email, int leadingSpaces ) +{ + // first, build a CPP Style license + + TQString strFill; + strFill.fill( ' ', leadingSpaces ); + + TQString str = + strFill + "/***************************************************************************\n" + + strFill + " * Copyright (C) $YEAR$ by $AUTHOR$ *\n" + + strFill + " * $EMAIL$ *\n" + + strFill + " * *\n"; + +// str = str.arg(TQDate::currentDate().year()).arg(author.left(45),-45).arg(email.left(67),-67); + + TQStringList::Iterator it; + for( it = m_rawLines.begin(); it != m_rawLines.end(); ++it ) + { + str += TQString( "%1 * %2 *\n").arg( strFill ).arg( *it, -69 ); + } + + str += strFill + " ***************************************************************************/\n"; + + switch( commentingStyle ) + { + case KDevFile::CPPStyle: + case KDevFile::CStyle: + return str; + + case KDevFile::PascalStyle: + str.replace(TQRegExp("/\\**\n \\*"), "{\n "); + str.replace(TQRegExp("\\*\n \\*"), " \n "); + str.replace(TQRegExp(" *\\**/\n"), "}\n"); + return str; + + case KDevFile::AdaStyle: + str.replace(TQRegExp("/\\*"), "--"); + str.replace(TQRegExp(" \\*"), "--"); + str.replace(TQRegExp("\\*/"), "*"); + return str; + + case KDevFile::BashStyle: + str.replace(TQRegExp("\\*|/"), "#"); + str.replace(TQRegExp("\n ##"), "\n##"); + str.replace(TQRegExp("\n #"), "\n# "); + return str; + + case KDevFile::XMLStyle: + str.replace(TQRegExp("/\\*"), "\n"); + str.replace(TQRegExp("\\*"), "_"); + return str; + } + + return "currently unknown/unsupported commenting style"; +} diff --git a/parts/appwizard/kdevlicense.h b/parts/appwizard/kdevlicense.h new file mode 100644 index 00000000..2e81c9ec --- /dev/null +++ b/parts/appwizard/kdevlicense.h @@ -0,0 +1,75 @@ +/* This file is part of the KDE project + Copyright (C) 2004 Sascha Cunz + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef KDEVLICENSE_H +#define KDEVLICENSE_H + +/** +@file kdevfile.h +The interface to installed licenses. +*/ + +#include + +#include "kdevfile.h" + +/*The interface to installed licenses.*/ +class KDevLicense +{ +public: + /**Constructs a KDevLicense and loads the given license template file. + @param name The name of this license. + @param fileName The file name where license template text is kept.*/ + KDevLicense(const TQString& name, const TQString& fileName); + +public: + /**Assembles the license to a string suitable for replacement of a %{LICENSE} .*/ + TQString assemble(KDevFile::CommentingStyle commentingStyle, const TQString& author, const TQString& email, int leadingSpaces ); + + /** + * returns the name of this license. + */ + TQString name() const { return m_name; } + + /** + * returns list of files tat must be present in the project's root directory + * if any source files uses this license. + */ + TQStringList copyFiles(){ return m_copyFiles; } + +private: + void readFile( const TQString& fileName ); + +private: + /** + * Name of this license + */ + TQString m_name; + /** + * Raw lines of the license. Should contain no spaces at + * the start or end of each line. + */ + TQStringList m_rawLines; + /** + * List of files that must be added to the project, if any + * file in the project uses this license. + */ + TQStringList m_copyFiles; +}; + +#endif diff --git a/parts/appwizard/profilesupport.cpp b/parts/appwizard/profilesupport.cpp index 3c5a5a35..ac5da870 100644 --- a/parts/appwizard/profilesupport.cpp +++ b/parts/appwizard/profilesupport.cpp @@ -24,9 +24,9 @@ #include #include -#include +#include -ProfileSupport::ProfileSupport(TDevPlugin *parent) +ProfileSupport::ProfileSupport(KDevPlugin *parent) { KURL::List resources = parent->pluginController()->profileResourcesRecursive("*.appwizard"); diff --git a/parts/appwizard/profilesupport.h b/parts/appwizard/profilesupport.h index 11e9b201..b18a9620 100644 --- a/parts/appwizard/profilesupport.h +++ b/parts/appwizard/profilesupport.h @@ -20,11 +20,11 @@ #ifndef PROFILESUPPORT_H #define PROFILESUPPORT_H -#include +#include class ProfileSupport{ public: - ProfileSupport(TDevPlugin *parent); + ProfileSupport(KDevPlugin *parent); bool isInTemplateList(const TQString &templateUrl); private: diff --git a/parts/appwizard/tdevappwizard.desktop b/parts/appwizard/tdevappwizard.desktop deleted file mode 100644 index bda84ba5..00000000 --- a/parts/appwizard/tdevappwizard.desktop +++ /dev/null @@ -1,87 +0,0 @@ -[Desktop Entry] -Type=Service -Exec=blubb -Comment=Application Wizard -Comment[br]=Skoazeller meziant -Comment[ca]=Assistent d'aplicacions -Comment[da]=Programguide -Comment[de]=Anwendungs-Assistent für TDevelop -Comment[el]=Μάγος εφαρμογής -Comment[es]=Asistente de aplicaciones -Comment[et]=Rakenduse nõustaja -Comment[eu]=Aplikazio morroia -Comment[fa]=جادوگر کاربرد -Comment[fr]=Assistant de création d'applications -Comment[ga]=Treoraí Feidhmchláir -Comment[gl]=Asistente de aplicación -Comment[hi]=अनुप्रयोग विज़ार्ड -Comment[hu]=Alkalmazásvarázsló -Comment[it]=Procedura guidata applicazione -Comment[ja]=アプリケーションウィザード -Comment[ms]=Wizard Aplikasi -Comment[nds]=Programm-Hölper -Comment[ne]=अनुप्रयोग विजार्ड -Comment[nl]=Toepassingassistent -Comment[pl]=Asystent tworzenia programu -Comment[pt]=Assistente de Aplicações -Comment[pt_BR]=Assistente de Aplicativo -Comment[ru]=Мастер создания приложений -Comment[sk]=Aplikačný sprievodca -Comment[sl]=Čarovnik za programe -Comment[sr]=Чаробњак за програме -Comment[sr@Latn]=Čarobnjak za programe -Comment[sv]=Programguide -Comment[ta]=பயன்பாட்டு வழிகாட்டி -Comment[tg]=Устои сохтани гузориш -Comment[tr]=Uygulama Sihirbazı -Comment[zh_CN]=应用程序向导 -Comment[zh_TW]=應用程式精靈 -Name=TDevAppWizard -Name[da]=TDevelop Programguide -Name[de]=Anwendungs-Assistent (TDevelop) -Name[hi]=के-डेव-एप-विज़ार्ड -Name[nds]=Programm-Hölper (TDevelop) -Name[pl]=KDevAsystentApli -Name[sk]=KDev aplikačný sprievodca -Name[sv]=TDevelop programguide -Name[zh_TW]=TDevelop 應用程式精靈 -GenericName=Application Wizard -GenericName[br]=Skoazeller meziant -GenericName[ca]=Assistent d'aplicacions -GenericName[da]=Programguide -GenericName[de]=Anwendungs-Assistent -GenericName[el]=Μάγος εφαρμογής -GenericName[es]=Asistente de aplicaciones -GenericName[et]=Rakenduse nõustaja -GenericName[eu]=Aplikazio morroia -GenericName[fa]=جادوگر کاربرد -GenericName[fr]=Assistant d'applications -GenericName[ga]=Treoraí Feidhmchláir -GenericName[gl]=Asistente de aplicación -GenericName[hi]=अनुप्रयोग विज़ार्ड -GenericName[hu]=Alkalmazásvarázsló -GenericName[it]=Procedura guidata applicazione -GenericName[ja]=アプリケーションウィザード -GenericName[ms]=Wizard Aplikasi -GenericName[nds]=Programm-Hölper -GenericName[ne]=अनुप्रयोग विजार्ड -GenericName[nl]=Toepassingassistent -GenericName[pl]=Asystent tworzenia programu -GenericName[pt]=Assistente de Aplicações -GenericName[pt_BR]=Assistente de Aplicativo -GenericName[ru]=Мастер создания приложений -GenericName[sk]=Aplikačný sprievodca -GenericName[sl]=Čarovnik za programe -GenericName[sr]=Чаробњак за програме -GenericName[sr@Latn]=Čarobnjak za programe -GenericName[sv]=Programguide -GenericName[ta]=பயன்பாடு வழிகாட்டி -GenericName[tg]=Устои сохтани гузориш -GenericName[tr]=Uygulama Sihirbazı -GenericName[zh_CN]=应用程序向导 -GenericName[zh_TW]=應用程式精靈 -ServiceTypes=TDevelop/Plugin -X-TDE-Library=libtdevappwizard -X-TDevelop-Scope=Core -X-TDevelop-Version=5 -X-TDevelop-Properties=ProjectCreation diff --git a/parts/appwizard/tdevappwizard.rc b/parts/appwizard/tdevappwizard.rc deleted file mode 100644 index 2705a29f..00000000 --- a/parts/appwizard/tdevappwizard.rc +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/parts/appwizard/tdevfile.cpp b/parts/appwizard/tdevfile.cpp deleted file mode 100644 index 4a748d47..00000000 --- a/parts/appwizard/tdevfile.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2004 Sascha Cunz - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -#include "tdevfile.h" - -static struct MimeTypeMapping -{ - const char* szMimeType; - TDevFile::CommentingStyle commentStyle; -} mimeTypeMapping[] = { -{ "text/x-c++hdr", TDevFile::CPPStyle }, -{ "text/x-c++src", TDevFile::CPPStyle }, -{ "text/x-chdr", TDevFile::CStyle }, -{ "text/x-csrc", TDevFile::CStyle }, -{ "text/adasrc", TDevFile::AdaStyle }, -{ "text/x-pascal", TDevFile::PascalStyle }, -{ "text/x-perl", TDevFile::BashStyle }, -{ "text/xml", TDevFile::XMLStyle }, -{ "text/x-xslt", TDevFile::XMLStyle }, -{ "text/x-xslfo", TDevFile::XMLStyle }, -{ "text/html", TDevFile::XMLStyle }, -{ "text/docbook", TDevFile::XMLStyle }, -{ "application/x-php", TDevFile::CPPStyle }, -{ "application/x-shellscript",TDevFile::BashStyle }, -{ NULL, TDevFile::NoCommenting } -}; - -TDevFile::CommentingStyle TDevFile::commentingStyleFromMimeType( const TQString& mimeType ) -{ - int idx = 0; - while( mimeTypeMapping[idx].szMimeType ) - { - if( mimeType == mimeTypeMapping[idx].szMimeType ) - return mimeTypeMapping[idx].commentStyle; - idx++; - } - return TDevFile::NoCommenting; -} - -TDevFile::CommentingStyle TDevFile::commentingStyleFromMimeType( KMimeType::Ptr mimeType ) -{ - return commentingStyleFromMimeType( mimeType->name() ); -} - diff --git a/parts/appwizard/tdevfile.h b/parts/appwizard/tdevfile.h deleted file mode 100644 index b1280f54..00000000 --- a/parts/appwizard/tdevfile.h +++ /dev/null @@ -1,57 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2004 Sascha Cunz - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -/** -@file tdevfile.h -File abstraction layer. -*/ -#ifndef TDEVFILE_H -#define TDEVFILE_H - -#include - -/** -File abstraction. -*/ -class TDevFile -{ -public: - /**Styles of comment-formats a source file can have.*/ - enum CommentingStyle - { - NoCommenting, //!< file seems to be unable to contain comments - CPPStyle, //!< C Style:
/* comment */
- CStyle, //!< C++ Style:
// comment
- AdaStyle, //!< Ada Style:
-- comment --
- PascalStyle, //!< Pascal Style:
{  comment  }
- BashStyle, //!< Shell Style:
#  comment
- XMLStyle //!< XML Style:
- }; - -public: - /**@return A commenting style for a given mime type. - @param mimeType A string which defines a mime type (like "text/x-c+++src").*/ - static CommentingStyle commentingStyleFromMimeType(const TQString& mimeType); - - /**@return A commenting style for a given mime type. - @param mimeType The mime type.*/ - static CommentingStyle commentingStyleFromMimeType( KMimeType::Ptr mimeType ); -}; - -#endif diff --git a/parts/appwizard/tdevlicense.cpp b/parts/appwizard/tdevlicense.cpp deleted file mode 100644 index a720c6c3..00000000 --- a/parts/appwizard/tdevlicense.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2004 Sascha Cunz - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -#include "tdevlicense.h" - -#include -#include -#include - -TDevLicense::TDevLicense( const TQString& name, const TQString& fileName ) - : m_name( name ) -{ - readFile( fileName ); -} - -void TDevLicense::readFile( const TQString& fileName ) -{ - TQFile f(fileName); - if (!f.open(IO_ReadOnly)) - return; - TQTextStream stream(&f); - TQString str; - enum { readingText, readingFiles } mode = readingText; - for(;;) - { - str = stream.readLine(); - if( str.isNull() ) - break; - if( str == "[FILES]" ) - mode = readingFiles; - else if( str == "[PREFIX]" ) - mode = readingText; - else if( mode == readingFiles ) - { - if( !str.isEmpty() ) - { - m_copyFiles.append( str ); - } - } else - m_rawLines.append( str ); - } - -} - -TQString TDevLicense::assemble( TDevFile::CommentingStyle commentingStyle, const TQString& author, const TQString& email, int leadingSpaces ) -{ - // first, build a CPP Style license - - TQString strFill; - strFill.fill( ' ', leadingSpaces ); - - TQString str = - strFill + "/***************************************************************************\n" + - strFill + " * Copyright (C) $YEAR$ by $AUTHOR$ *\n" + - strFill + " * $EMAIL$ *\n" + - strFill + " * *\n"; - -// str = str.arg(TQDate::currentDate().year()).arg(author.left(45),-45).arg(email.left(67),-67); - - TQStringList::Iterator it; - for( it = m_rawLines.begin(); it != m_rawLines.end(); ++it ) - { - str += TQString( "%1 * %2 *\n").arg( strFill ).arg( *it, -69 ); - } - - str += strFill + " ***************************************************************************/\n"; - - switch( commentingStyle ) - { - case TDevFile::CPPStyle: - case TDevFile::CStyle: - return str; - - case TDevFile::PascalStyle: - str.replace(TQRegExp("/\\**\n \\*"), "{\n "); - str.replace(TQRegExp("\\*\n \\*"), " \n "); - str.replace(TQRegExp(" *\\**/\n"), "}\n"); - return str; - - case TDevFile::AdaStyle: - str.replace(TQRegExp("/\\*"), "--"); - str.replace(TQRegExp(" \\*"), "--"); - str.replace(TQRegExp("\\*/"), "*"); - return str; - - case TDevFile::BashStyle: - str.replace(TQRegExp("\\*|/"), "#"); - str.replace(TQRegExp("\n ##"), "\n##"); - str.replace(TQRegExp("\n #"), "\n# "); - return str; - - case TDevFile::XMLStyle: - str.replace(TQRegExp("/\\*"), "\n"); - str.replace(TQRegExp("\\*"), "_"); - return str; - } - - return "currently unknown/unsupported commenting style"; -} diff --git a/parts/appwizard/tdevlicense.h b/parts/appwizard/tdevlicense.h deleted file mode 100644 index d61aebc3..00000000 --- a/parts/appwizard/tdevlicense.h +++ /dev/null @@ -1,75 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2004 Sascha Cunz - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -#ifndef TDEVLICENSE_H -#define TDEVLICENSE_H - -/** -@file tdevfile.h -The interface to installed licenses. -*/ - -#include - -#include "tdevfile.h" - -/*The interface to installed licenses.*/ -class TDevLicense -{ -public: - /**Constructs a TDevLicense and loads the given license template file. - @param name The name of this license. - @param fileName The file name where license template text is kept.*/ - TDevLicense(const TQString& name, const TQString& fileName); - -public: - /**Assembles the license to a string suitable for replacement of a %{LICENSE} .*/ - TQString assemble(TDevFile::CommentingStyle commentingStyle, const TQString& author, const TQString& email, int leadingSpaces ); - - /** - * returns the name of this license. - */ - TQString name() const { return m_name; } - - /** - * returns list of files tat must be present in the project's root directory - * if any source files uses this license. - */ - TQStringList copyFiles(){ return m_copyFiles; } - -private: - void readFile( const TQString& fileName ); - -private: - /** - * Name of this license - */ - TQString m_name; - /** - * Raw lines of the license. Should contain no spaces at - * the start or end of each line. - */ - TQStringList m_rawLines; - /** - * List of files that must be added to the project, if any - * file in the project uses this license. - */ - TQStringList m_copyFiles; -}; - -#endif -- cgit v1.2.1