diff options
| author | Dominik Haumann <dhaumann@kde.org> | 2012-10-25 20:16:07 (GMT) |
|---|---|---|
| committer | Dominik Haumann <dhaumann@kde.org> | 2012-10-25 20:16:07 (GMT) |
| commit | 650ee880188bd49614d5a4d65d7b9e373fbec0bb (patch) | |
| tree | c25995971356fd73ffc22c8e2a787e4f3c04f394 | |
| parent | 20f3ac65359db8f46a49044d1adc211608d9208f (diff) | |
remove deprecated new-stuff support, that never got ported since KDE 3
BUG: 306280
4 files changed, 4 insertions, 81 deletions
diff --git a/kate/plugins/filetemplates/plugin/CMakeLists.txt b/kate/plugins/filetemplates/plugin/CMakeLists.txt index 4d1bb5d..d1079f7 100644 --- a/kate/plugins/filetemplates/plugin/CMakeLists.txt +++ b/kate/plugins/filetemplates/plugin/CMakeLists.txt @@ -1,10 +1,4 @@ # TODO: port away from QT3_SUPPORT! -# TODO: port to KNEWSTUFF3 - - -if( KDE_PLATFORM_FEATURE_DISABLE_DEPRECATED) - message(STATUS "Disabling katefiletemplates, which depends on deprecated knewstuff2. TODO: port to knewstuff3.") -else() add_definitions(-DQT3_SUPPORT) @@ -14,7 +8,7 @@ set(katefiletemplates_PART_SRCS filetemplates.cpp ) kde4_add_plugin(katefiletemplates ${katefiletemplates_PART_SRCS}) -target_link_libraries(katefiletemplates ${KDE4_KNEWSTUFF2_LIBS} kateinterfaces ${KDE4_KTEXTEDITOR_LIBS} ) +target_link_libraries(katefiletemplates kateinterfaces ${KDE4_KTEXTEDITOR_LIBS} ) install(TARGETS katefiletemplates DESTINATION ${PLUGIN_INSTALL_DIR} ) @@ -24,6 +18,3 @@ install(TARGETS katefiletemplates DESTINATION ${PLUGIN_INSTALL_DIR} ) install( FILES ui.rc DESTINATION ${DATA_INSTALL_DIR}/kate/plugins/katefiletemplates ) install( FILES katetemplate.xml DESTINATION ${DATA_INSTALL_DIR}/katepart/syntax ) install( FILES katefiletemplates.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES katefiletemplates.knsrc DESTINATION ${CONFIG_INSTALL_DIR} ) - -endif() diff --git a/kate/plugins/filetemplates/plugin/filetemplates.cpp b/kate/plugins/filetemplates/plugin/filetemplates.cpp index 963f051..a2cd504 100644 --- a/kate/plugins/filetemplates/plugin/filetemplates.cpp +++ b/kate/plugins/filetemplates/plugin/filetemplates.cpp @@ -38,8 +38,6 @@ #include <klineedit.h> #include <klocale.h> #include <kmessagebox.h> -// #include <knewstuff2/core/entry.h> -#include <knewstuff2/engine.h> #include <kstandarddirs.h> #include <ktemporaryfile.h> #include <kurlrequester.h> @@ -1064,12 +1062,12 @@ KateTemplateManager::KateTemplateManager( KateFileTemplates *kft, QWidget *paren : QWidget( parent, name ) , kft( kft ) { - QGridLayout *lo = new QGridLayout( this, 2, 6 ); + QGridLayout *lo = new QGridLayout( this, 2, 4 ); lo->setSpacing( KDialog::spacingHint() ); lvTemplates = new QTreeWidget( this ); lvTemplates->setHeaderLabel( i18n("Template") ); lvTemplates->setSelectionMode( QAbstractItemView::SingleSelection ); - lo->addMultiCellWidget( lvTemplates, 1, 1, 1, 6 ); + lo->addMultiCellWidget( lvTemplates, 1, 1, 1, 4 ); connect( lvTemplates, SIGNAL(itemSelectionChanged()), this, SLOT(slotUpdateState()) ); btnNew = new QPushButton( i18nc("@action:button Template", "New..."), this ); @@ -1084,14 +1082,6 @@ KateTemplateManager::KateTemplateManager( KateFileTemplates *kft, QWidget *paren connect( btnRemove, SIGNAL(clicked()), this, SLOT(slotRemoveTemplate()) ); lo->addWidget( btnRemove, 2, 4 ); - btnUpload = new QPushButton( i18nc("@action:button Template", "Upload..."), this ); - connect( btnUpload, SIGNAL(clicked()), this, SLOT(slotUpload()) ); - lo->addWidget( btnUpload, 2, 5 ); - - btnDownload = new QPushButton( i18nc("@action:button Template", "Download..."), this ); - connect( btnDownload, SIGNAL(clicked()), this, SLOT(slotDownload()) ); - lo->addWidget( btnDownload, 2, 6 ); - lo->setColumnStretch( 1, 1 ); reload(); @@ -1133,7 +1123,6 @@ void KateTemplateManager::slotUpdateState() btnEdit->setEnabled( cool ); btnRemove->setEnabled( cool ); - btnUpload->setEnabled( cool ); } void KateTemplateManager::slotEditTemplate() @@ -1183,62 +1172,10 @@ void KateTemplateManager::slotRemoveTemplate() cg.writeXdgListEntry( "Hidden", l ); // XXX this is bogus } - // If we removed any files, we should delete a KNewStuff key - // for this template, so the template is installable again. - // ### This assumes that the knewstuff name is similar to the template name. - kDebug()<<"trying to remove knewstuff key '"<<info->tmplate<<"'"; - config->group("KNewStuffStatus").deleteEntry( info->tmplate ); - kft->updateTemplateDirs(); reload(); } } - -// KNewStuff upload -void KateTemplateManager::slotUpload() -{ - // TODO something nicer, like preparing the meta data from the template info. -// KateTemplateItem *item = dynamic_cast<KateTemplateItem*>( lvTemplates->currentItem() ); -// if ( item ) -// { -// KFTNewStuff *ns = new KFTNewStuff( "katefiletemplates/template", this ); -// ns->upload( item->templateinfo->filename, QString() ); -// } -//### warning ERROR HANDLING -// KateTemplateItem *item = dynamic_cast<KateTemplateItem*>( lvTemplates->currentItem() ); -// if (!item) return; -// KNS::Engine *engine=new KNS::Engine(this); -// bool success=engine->init("katefiletemplates.knsrc"); -// if (!success) -// { -// delete engine; -// return; -// } -// engine->uploadDialogModal(item->templateinfo->filename); -// delete engine; - -} - -// KNewStuff download -void KateTemplateManager::slotDownload() -{ -// KFTNewStuff *ns = new KFTNewStuff( "katefiletemplates/template", this ); -// ns->download(); -//### warning ERROR HANDLING - KNS::Engine *engine=new KNS::Engine(this); - bool success=engine->init("katefiletemplates.knsrc"); - if (!success) - { - delete engine; - return; - } - engine->downloadDialogModal(); - delete engine; - - kft->updateTemplateDirs(); - reload(); -} - //END KateTemplateManager // kate: space-indent on; indent-width 2; replace-tabs on; diff --git a/kate/plugins/filetemplates/plugin/filetemplates.h b/kate/plugins/filetemplates/plugin/filetemplates.h index b74de78..bd6ae51 100644 --- a/kate/plugins/filetemplates/plugin/filetemplates.h +++ b/kate/plugins/filetemplates/plugin/filetemplates.h @@ -227,15 +227,13 @@ class KateTemplateManager : public QWidget void reset() { reload(); } private slots: - void slotUpload(); - void slotDownload(); void slotUpdateState(); void slotEditTemplate(); void slotRemoveTemplate(); private: class QTreeWidget *lvTemplates; - class QPushButton *btnNew, *btnEdit, *btnRemove, *btnDownload, *btnUpload; + class QPushButton *btnNew, *btnEdit, *btnRemove; KateFileTemplates *kft; // QList<class TemplateInfo> *remove; diff --git a/kate/plugins/filetemplates/plugin/katefiletemplates.knsrc b/kate/plugins/filetemplates/plugin/katefiletemplates.knsrc deleted file mode 100644 index ae317d3..0000000 --- a/kate/plugins/filetemplates/plugin/katefiletemplates.knsrc +++ /dev/null @@ -1,3 +0,0 @@ -[KNewStuff2] -ProvidersUrl=http://localhost/kate_filetemplate_providers.xml -TargetDir=kate/plugins/katefiletemplates/templates
\ No newline at end of file |
