From 782ea254f2b2cc59c01c9fa9c26df3262b05648a Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 27 Jan 2013 01:03:10 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- kig/ChangeLog | 12 +-- kig/Makefile.am | 6 +- kig/kfile/Makefile.am | 24 ------ kig/kfile/kfile_drgeo.cpp | 99 ------------------------ kig/kfile/kfile_drgeo.desktop | 55 -------------- kig/kfile/kfile_drgeo.h | 42 ----------- kig/kfile/kfile_kig.cpp | 153 -------------------------------------- kig/kfile/kfile_kig.desktop | 54 -------------- kig/kfile/kfile_kig.h | 42 ----------- kig/kig/kig.cpp | 4 +- kig/kig/kig_part.cpp | 2 +- kig/misc/kigfiledialog.h | 2 +- kig/modes/typesdialog.cpp | 2 +- kig/tdefile/Makefile.am | 24 ++++++ kig/tdefile/tdefile_drgeo.cpp | 99 ++++++++++++++++++++++++ kig/tdefile/tdefile_drgeo.desktop | 55 ++++++++++++++ kig/tdefile/tdefile_drgeo.h | 42 +++++++++++ kig/tdefile/tdefile_kig.cpp | 153 ++++++++++++++++++++++++++++++++++++++ kig/tdefile/tdefile_kig.desktop | 54 ++++++++++++++ kig/tdefile/tdefile_kig.h | 42 +++++++++++ 20 files changed, 483 insertions(+), 483 deletions(-) delete mode 100644 kig/kfile/Makefile.am delete mode 100644 kig/kfile/kfile_drgeo.cpp delete mode 100644 kig/kfile/kfile_drgeo.desktop delete mode 100644 kig/kfile/kfile_drgeo.h delete mode 100644 kig/kfile/kfile_kig.cpp delete mode 100644 kig/kfile/kfile_kig.desktop delete mode 100644 kig/kfile/kfile_kig.h create mode 100644 kig/tdefile/Makefile.am create mode 100644 kig/tdefile/tdefile_drgeo.cpp create mode 100644 kig/tdefile/tdefile_drgeo.desktop create mode 100644 kig/tdefile/tdefile_drgeo.h create mode 100644 kig/tdefile/tdefile_kig.cpp create mode 100644 kig/tdefile/tdefile_kig.desktop create mode 100644 kig/tdefile/tdefile_kig.h (limited to 'kig') diff --git a/kig/ChangeLog b/kig/ChangeLog index 8845e357..48a0a4e5 100644 --- a/kig/ChangeLog +++ b/kig/ChangeLog @@ -105,7 +105,7 @@ 2005-05-25 Pino Toscano - * The kfile_kig displays also whether the file is compressed or + * The tdefile_kig displays also whether the file is compressed or not. 2005-05-21 Pino Toscano @@ -127,7 +127,7 @@ 2005-05-19 Pino Toscano - * Give to the kfile_kig the ability to read info from compressed + * Give to the tdefile_kig the ability to read info from compressed files. 2005-05-15 Danny Allen @@ -498,7 +498,7 @@ * Small changes to Script Wizard UI. - * kfile_kig read also the compatibility version. + * tdefile_kig read also the compatibility version. 2004-07-21 Pino Toscano @@ -592,7 +592,7 @@ * Fixed a small bug that leads to display "Select the point" when I reset the name of an object after setting it. - * i18n fixes in kfile_kig. + * i18n fixes in tdefile_kig. 2004-06-29 Dominique Devriese @@ -606,7 +606,7 @@ 2004-06-15 Pino Toscano - * Add info about whether grid and axes are shown to the kig kfile + * Add info about whether grid and axes are shown to the kig tdefile thing. * Now the coordinate system toggleaction is correctly updated @@ -742,7 +742,7 @@ * Add a Copy action to text labels to copy their text ( with substitutions already made ) into the clipboard. - * Add two little kfile plugins: kfile_kig and kfile_drgeo. + * Add two little tdefile plugins: tdefile_kig and tdefile_drgeo. * Various little improvements diff --git a/kig/Makefile.am b/kig/Makefile.am index e011bf79..d7eb4457 100644 --- a/kig/Makefile.am +++ b/kig/Makefile.am @@ -18,7 +18,7 @@ SUBDIRS = \ kig \ mimetypes \ macros \ - kfile \ + tdefile \ data \ pykig \ $(scriptingdir) @@ -42,8 +42,8 @@ messages: rc.cpp cat "$$file" | grep '' | sed -e 's/^ *\([^<]*\)<\/SelectStatement>/i18n( "\1" );/' | sed -e 's/&/\&/g' >> rc.cpp; \ done $(XGETTEXT) tips.cpp rc.cpp filters/*.h kig/*.h misc/*.h modes/*.h objects/*.h scripting/*.h */*.cc kig/*.cpp misc/*.cpp modes/*.cpp -o $(podir)/kig.pot - $(XGETTEXT) kfile/kfile_drgeo.cpp kfile/kfile_drgeo.h -o $(podir)/kfile_drgeo.pot - $(XGETTEXT) kfile/kfile_kig.cpp kfile/kfile_kig.h -o $(podir)/kfile_kig.pot + $(XGETTEXT) tdefile/tdefile_drgeo.cpp tdefile/tdefile_drgeo.h -o $(podir)/tdefile_drgeo.pot + $(XGETTEXT) tdefile/tdefile_kig.cpp tdefile/tdefile_kig.h -o $(podir)/tdefile_kig.pot CLEANFILES = dummy.cpp diff --git a/kig/kfile/Makefile.am b/kig/kfile/Makefile.am deleted file mode 100644 index 715a9c7a..00000000 --- a/kig/kfile/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -INCLUDES = $(all_includes) - -noinst_HEADERS = \ - kfile_drgeo.h \ - kfile_kig.h - -kde_module_LTLIBRARIES = \ - kfile_drgeo.la \ - kfile_kig.la - -kfile_drgeo_la_SOURCES = kfile_drgeo.cpp -kfile_drgeo_la_LDFLAGS = $(all_libraries) $(LIB_QT) $(LIB_TDECORE) $(LIB_TDEUI) $(LIB_KIO) -module $(KDE_PLUGIN) -kfile_drgeo_la_LIBADD = $(LIB_KIO) - -kfile_kig_la_SOURCES = kfile_kig.cpp -kfile_kig_la_LDFLAGS = $(all_libraries) $(LIB_QT) $(LIB_TDECORE) $(LIB_TDEUI) $(LIB_KIO) -module $(KDE_PLUGIN) -kfile_kig_la_LIBADD = $(LIB_KIO) - -METASOURCES = AUTO - -services_DATA = \ - kfile_drgeo.desktop \ - kfile_kig.desktop -servicesdir = $(kde_servicesdir) diff --git a/kig/kfile/kfile_drgeo.cpp b/kig/kfile/kfile_drgeo.cpp deleted file mode 100644 index b921131b..00000000 --- a/kig/kfile/kfile_drgeo.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by Pino Toscano * - * toscano.pino@tiscali.it * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include "kfile_drgeo.h" - -#include -#include - -#include - -typedef KGenericFactory drgeoFactory; - -K_EXPORT_COMPONENT_FACTORY( kfile_drgeo, drgeoFactory( "kfile_drgeo" ) ) - -DrgeoPlugin::DrgeoPlugin( TQObject *parent, const char *name, const TQStringList &args ) - : KFilePlugin( parent, name, args ) -{ - info = addMimeTypeInfo( "application/x-drgeo" ); - - KFileMimeTypeInfo::GroupInfo* group = addGroupInfo( info, "DrgeoInfo", i18n( "Summary" ) ); - KFileMimeTypeInfo::ItemInfo* item; - item = addItemInfo( group, "NumOfFigures", i18n( "Figures" ), TQVariant::Int ); - item = addItemInfo( group, "NumOfTexts", i18n( "Texts" ), TQVariant::Int ); - item = addItemInfo( group, "NumOfMacros", i18n( "Macros" ), TQVariant::Int ); - - group_contents = addGroupInfo( info, "DrgeoContents", i18n( "Translators: what this drgeo " - "file contains", "Contents" ) ); -} - -bool DrgeoPlugin::readInfo( KFileMetaInfo& metainfo, uint /*what*/ ) -{ - KFileMetaInfoGroup metagroup = appendGroup( metainfo, "DrgeoContents"); - - KFileMimeTypeInfo::ItemInfo* item; - - TQFile f( metainfo.path() ); - TQDomDocument doc( "drgenius" ); - if ( !doc.setContent( &f ) ) - return false; - TQDomElement main = doc.documentElement(); - int numfig = 0; - int numtext = 0; - int nummacro = 0; - TQString sectname; - // reading figures... - for ( TQDomNode n = main.firstChild(); ! n.isNull(); n = n.nextSibling() ) - { - TQDomElement e = n.toElement(); - if ( e.isNull() ) continue; - else if ( e.tagName() == "drgeo" ) - { - numfig++; - sectname = TQString( "Figure" ) + TQString::number( numfig ); - item = addItemInfo( group_contents, sectname, i18n( "Figure" ), TQVariant::String ); - appendItem( metagroup, sectname, e.attribute( "name" ) ); - } - else if ( e.tagName() == "text" ) - { - numtext++; - sectname = TQString( "Text" ) + TQString::number( numtext ); - item = addItemInfo( group_contents, sectname, i18n( "Text" ), TQVariant::String ); - appendItem( metagroup, sectname, e.attribute( "name" ) ); - } - else if ( e.tagName() == "macro" ) - { - nummacro++; - sectname = TQString( "Macro" ) + TQString::number( nummacro ); - item = addItemInfo( group_contents, sectname, i18n( "Macro" ), TQVariant::String ); - appendItem( metagroup, sectname, e.attribute( "name" ) ); - } - } - - metagroup = appendGroup( metainfo, "DrgeoInfo"); - appendItem( metagroup, "NumOfFigures", numfig ); - appendItem( metagroup, "NumOfTexts", numtext ); - appendItem( metagroup, "NumOfMacros", nummacro ); - - return true; -} - -#include "kfile_drgeo.moc" - diff --git a/kig/kfile/kfile_drgeo.desktop b/kig/kfile/kfile_drgeo.desktop deleted file mode 100644 index b33e255f..00000000 --- a/kig/kfile/kfile_drgeo.desktop +++ /dev/null @@ -1,55 +0,0 @@ -[Desktop Entry] -Type=Service -Name=Dr. Geo Info -Name[af]=Dr. Geo inligting -Name[be]=Звесткі Dr. Geo -Name[bn]=ড. জিও সংক্রান্ত তথ্য -Name[br]=Titouroù diwar-benn Dr. Geo -Name[ca]=Informació Dr. Geo -Name[cs]=Dr. Geo info -Name[csb]=Wëdowiédzô Dr Geo -Name[cy]=Gwybodaeth Dr. Geo -Name[da]=Dr. Geo info -Name[el]=Πληροφορίες για το Dr. Geo -Name[eo]=Dr. Geo info -Name[es]=Información de Dr. Geo -Name[et]=Dr. Geo info -Name[eu]=Dr. Geo informazioa -Name[fa]=اطلاعات دکتر جیو -Name[fi]=Dr. Geo -Name[fr]=Informations de Dr. Geo -Name[ga]=Eolas faoi Dr. Geo -Name[gl]=Información de Dr. Geo -Name[he]=מידע על Dr. Geo -Name[hi]=डॉ. जिओ जानकारी -Name[hu]=Dr. Geo-jellemzők -Name[is]=Dr. Geo upplýsingar -Name[it]=Informazioni Dr. Geo -Name[ja]=Dr. Geo 情報 -Name[ka]=Dr. Geo - მონაცემები -Name[km]=ព័ត៌មាន Dr. Geo -Name[mk]=Dr. Geo инфо -Name[nb]=Dr. Geo-info -Name[ne]=डा. जिव जानकारी -Name[nn]=Dr. Geo-info -Name[pa]=Dr. Geo ਜਾਣਕਾਰੀ -Name[pl]=Informacja Dr. Geo -Name[pt]=Informação do Dr. Geo -Name[pt_BR]=Informações do Dr. Geo -Name[ru]=Файл Dr. Geo -Name[sl]=Podatki Dr. Geo -Name[sr]=Dr. Geo информације -Name[sr@Latn]=Dr. Geo informacije -Name[sv]=Dr. Geo-information -Name[ta]=டா. ஜியோ தகவல் -Name[tg]=Ахборот дар бораи Геометрия -Name[tr]=Dr. Geo Bilgisi -Name[uk]=Інформація для Dr. Geo -Name[vi]=Tiến sĩ Thông tin Hình học -Name[zh_CN]=Dr. Geo 信息 -Name[zh_TW]=Dr. Geo 資訊 -ServiceTypes=KFilePlugin -X-TDE-Library=kfile_drgeo -MimeType=application/x-drgeo -PreferredGroups=DrgeoInfo -PreferredItems=NumOfFigures;NumOfTexts;NumOfMacros diff --git a/kig/kfile/kfile_drgeo.h b/kig/kfile/kfile_drgeo.h deleted file mode 100644 index 94b6f696..00000000 --- a/kig/kfile/kfile_drgeo.h +++ /dev/null @@ -1,42 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by Pino Toscano * - * toscano.pino@tiscali.it * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef KIG_KFILE_KFILE_DRGEO_H -#define KIG_KFILE_KFILE_DRGEO_H - -#include - -class TQStringList; - -class DrgeoPlugin: public KFilePlugin -{ - Q_OBJECT - - -public: - DrgeoPlugin( TQObject *parent, const char *name, const TQStringList& args ); - - virtual bool readInfo( KFileMetaInfo& metainfo, uint what); -protected: - KFileMimeTypeInfo* info; - KFileMimeTypeInfo::GroupInfo* group_contents; -}; - -#endif diff --git a/kig/kfile/kfile_kig.cpp b/kig/kfile/kfile_kig.cpp deleted file mode 100644 index d44eb1fa..00000000 --- a/kig/kfile/kfile_kig.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by Pino Toscano * - * toscano.pino@tiscali.it * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include "kfile_kig.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -typedef KGenericFactory kigFactory; - -K_EXPORT_COMPONENT_FACTORY( kfile_kig, kigFactory( "kfile_kig" ) ) - -KigPlugin::KigPlugin( TQObject *parent, const char *name, const TQStringList &args ) - : KFilePlugin( parent, name, args ) -{ - KFileMimeTypeInfo::ItemInfo* item; - - info = addMimeTypeInfo( "application/x-kig" ); - - group = addGroupInfo( info, "KigInfo", i18n( "Summary" ) ); - item = addItemInfo( group, "Version", i18n( "Version" ), TQVariant::String ); - item = addItemInfo( group, "CompatVersion", i18n( "Compatibility Version" ), TQVariant::String ); - item = addItemInfo( group, "CoordSystem", i18n( "Coordinate System" ), TQVariant::String ); - item = addItemInfo( group, "Grid", i18n( "Grid" ), TQVariant::String ); - item = addItemInfo( group, "Axes", i18n( "Axes" ), TQVariant::String ); - item = addItemInfo( group, "Compressed", i18n( "Compressed" ), TQVariant::String ); -} - -bool KigPlugin::readInfo( KFileMetaInfo& metainfo, uint /*what*/ ) -{ - KFileMetaInfoGroup metagroup = appendGroup( metainfo, "KigInfo"); - - TQString sfile = metainfo.path(); - bool iscompressed = false; - TQFile f( sfile ); - if ( !sfile.endsWith( ".kig", false ) ) - { - iscompressed = true; - - TQString tempdir = TDEGlobal::dirs()->saveLocation( "tmp" ); - if ( tempdir.isEmpty() ) - return false; - - TQString tempname = sfile.section( '/', -1 ); - if ( sfile.endsWith( ".kigz", false ) ) - { - tempname.remove( TQRegExp( "\\.[Kk][Ii][Gg][Zz]$" ) ); - } - else - return false; - // reading compressed file - KTar* ark = new KTar( sfile, "application/x-gzip" ); - ark->open( IO_ReadOnly ); - const KArchiveDirectory* dir = ark->directory(); - TQStringList entries = dir->entries(); - TQStringList kigfiles = entries.grep( TQRegExp( "\\.kig$" ) ); - if ( kigfiles.count() != 1 ) - return false; - const KArchiveEntry* kigz = dir->entry( kigfiles[0] ); - if ( !kigz->isFile() ) - return false; - dynamic_cast( kigz )->copyTo( tempdir ); - - f.setName( tempdir + kigz->name() ); - } - - if ( !f.open( IO_ReadOnly ) ) - return false; - - TQDomDocument doc( "KigDocument" ); - if ( !doc.setContent( &f ) ) - return false; - - f.close(); - - // removing temp file - if ( iscompressed ) - f.remove(); - - TQDomElement main = doc.documentElement(); - - // reading the version... - TQString version = main.attribute( "Version" ); - if ( version.isEmpty() ) version = main.attribute( "version" ); - if ( version.isEmpty() ) version = i18n( "Translators: Not Available", "n/a" ); - appendItem( metagroup, "Version", version ); - - // reading the compatibility version... - TQString compatversion = main.attribute( "CompatibilityVersion" ); - if ( compatversion.isEmpty() ) - compatversion = i18n( "%1 represents Kig version", - "%1 (as the version)" ).arg( version ); - appendItem( metagroup, "CompatVersion", compatversion ); - - // reading the Coordinate System... - TQCString coordsystem; - for ( TQDomNode n = main.firstChild(); ! n.isNull(); n = n.nextSibling() ) - { - TQDomElement e = n.toElement(); - if ( e.isNull() ) continue; - if ( e.tagName() == "CoordinateSystem" ) - coordsystem = e.text().latin1(); - } - appendItem( metagroup, "CoordSystem", coordsystem ); - - // has Kig document the grid? - bool btmp = true; - TQString stmp = main.attribute( "grid" ); - if ( !( stmp.isEmpty() || ( stmp != "0" ) ) ) - btmp = ( stmp != "0" ); - TQString stmp2 = btmp ? i18n( "Yes" ) : i18n( "No" ); - appendItem( metagroup, "Grid", stmp2 ); - - // has Kig document the axes? - btmp = true; - stmp = main.attribute( "axes" ); - if ( !( stmp.isEmpty() || ( stmp != "0" ) ) ) - btmp = ( stmp != "0" ); - stmp2 = btmp ? i18n( "Yes" ) : i18n( "No" ); - appendItem( metagroup, "Axes", stmp2 ); - - stmp2 = iscompressed ? i18n( "Yes" ) : i18n( "No" ); - appendItem( metagroup, "Compressed", stmp2 ); - - return true; -} - -#include "kfile_kig.moc" diff --git a/kig/kfile/kfile_kig.desktop b/kig/kfile/kfile_kig.desktop deleted file mode 100644 index 19c37422..00000000 --- a/kig/kfile/kfile_kig.desktop +++ /dev/null @@ -1,54 +0,0 @@ -[Desktop Entry] -Type=Service -Name=Kig Info -Name[af]=Kig inligting -Name[be]=Звесткі Kig -Name[bn]=কিগ সংক্রান্ত তথ্য -Name[br]=Titouroù diwar-benn Kig -Name[ca]=Informació Kig -Name[cs]=Kig info -Name[csb]=Wëdowiédzô Kig -Name[cy]=Gwybodaeth Kig -Name[da]=Kig info -Name[el]=Πληροφορίες για το Kig -Name[eo]=Kig info -Name[es]=Información de Kig -Name[et]=Kigi info -Name[eu]=Kig informazioa -Name[fa]=اطلاعات Kig -Name[fr]=Informations de Kig -Name[ga]=Eolas faoi Kig -Name[gl]=Información de Kig -Name[he]=Kig מידע -Name[hi]=केआईजी जानकारी -Name[hu]=Kig-jellemzők -Name[is]=Kig upplýsingar -Name[it]=Informazioni Kig -Name[ja]=Kig 情報 -Name[ka]=Kig - მონაცემები -Name[km]=ព័ត៌មាន Kig -Name[mk]=Kig инфо -Name[nb]=Kig-info -Name[ne]=किग जानकारी -Name[nn]=Kig-info -Name[pa]=ਕਿਗ ਜਾਣਕਾਰੀ -Name[pl]=Informacja Kig -Name[pt]=Informação do Kig -Name[pt_BR]=Informações do Kig -Name[ru]=Файл Kig -Name[sl]=Podatki Kig -Name[sr]=Kig информације -Name[sr@Latn]=Kig informacije -Name[sv]=Kig-information -Name[ta]=கிக் தகவல் -Name[tg]=Ахборот дар бораи Kig -Name[tr]=Kig Bilgisi -Name[uk]=Інформація для Kig -Name[vi]=Thông tin Kig -Name[zh_CN]=Kig 信息 -Name[zh_TW]=Kig 資訊 -ServiceTypes=KFilePlugin -X-TDE-Library=kfile_kig -MimeType=application/x-kig -PreferredGroups=KigInfo -PreferredItems=Version;CoordSytem diff --git a/kig/kfile/kfile_kig.h b/kig/kfile/kfile_kig.h deleted file mode 100644 index 5d1790ce..00000000 --- a/kig/kfile/kfile_kig.h +++ /dev/null @@ -1,42 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by Pino Toscano * - * toscano.pino@tiscali.it * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef KIG_KFILE_KFILE_KIG_H -#define KIG_KFILE_KFILE_KIG_H - -#include - -class TQStringList; - -class KigPlugin: public KFilePlugin -{ - Q_OBJECT - - -public: - KigPlugin( TQObject *parent, const char *name, const TQStringList& args ); - - virtual bool readInfo( KFileMetaInfo& metainfo, uint what); -protected: - KFileMimeTypeInfo* info; - KFileMimeTypeInfo::GroupInfo* group; -}; - -#endif diff --git a/kig/kig/kig.cpp b/kig/kig/kig.cpp index 13cbd8b7..b0eda780 100644 --- a/kig/kig/kig.cpp +++ b/kig/kig/kig.cpp @@ -26,10 +26,10 @@ #include #include -#include +#include #include #include -#include +#include #include #include #include diff --git a/kig/kig/kig_part.cpp b/kig/kig/kig_part.cpp index a8117c6e..ef7fa470 100644 --- a/kig/kig/kig_part.cpp +++ b/kig/kig/kig_part.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kig/misc/kigfiledialog.h b/kig/misc/kigfiledialog.h index d1acc1fd..14c53a2d 100644 --- a/kig/misc/kigfiledialog.h +++ b/kig/misc/kigfiledialog.h @@ -18,7 +18,7 @@ #ifndef KIG_MISC_KIGFILEDIALOG_H #define KIG_MISC_KIGFILEDIALOG_H -#include +#include /** * This file dialog is pretty like KFileDialog, but allow us to make an option diff --git a/kig/modes/typesdialog.cpp b/kig/modes/typesdialog.cpp index ec6a16c3..db30d652 100644 --- a/kig/modes/typesdialog.cpp +++ b/kig/modes/typesdialog.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include #include diff --git a/kig/tdefile/Makefile.am b/kig/tdefile/Makefile.am new file mode 100644 index 00000000..fc0e4c0f --- /dev/null +++ b/kig/tdefile/Makefile.am @@ -0,0 +1,24 @@ +INCLUDES = $(all_includes) + +noinst_HEADERS = \ + tdefile_drgeo.h \ + tdefile_kig.h + +kde_module_LTLIBRARIES = \ + tdefile_drgeo.la \ + tdefile_kig.la + +tdefile_drgeo_la_SOURCES = tdefile_drgeo.cpp +tdefile_drgeo_la_LDFLAGS = $(all_libraries) $(LIB_QT) $(LIB_TDECORE) $(LIB_TDEUI) $(LIB_KIO) -module $(KDE_PLUGIN) +tdefile_drgeo_la_LIBADD = $(LIB_KIO) + +tdefile_kig_la_SOURCES = tdefile_kig.cpp +tdefile_kig_la_LDFLAGS = $(all_libraries) $(LIB_QT) $(LIB_TDECORE) $(LIB_TDEUI) $(LIB_KIO) -module $(KDE_PLUGIN) +tdefile_kig_la_LIBADD = $(LIB_KIO) + +METASOURCES = AUTO + +services_DATA = \ + tdefile_drgeo.desktop \ + tdefile_kig.desktop +servicesdir = $(kde_servicesdir) diff --git a/kig/tdefile/tdefile_drgeo.cpp b/kig/tdefile/tdefile_drgeo.cpp new file mode 100644 index 00000000..0f7eb3ee --- /dev/null +++ b/kig/tdefile/tdefile_drgeo.cpp @@ -0,0 +1,99 @@ +/*************************************************************************** + * Copyright (C) 2004 by Pino Toscano * + * toscano.pino@tiscali.it * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#include "tdefile_drgeo.h" + +#include +#include + +#include + +typedef KGenericFactory drgeoFactory; + +K_EXPORT_COMPONENT_FACTORY( tdefile_drgeo, drgeoFactory( "tdefile_drgeo" ) ) + +DrgeoPlugin::DrgeoPlugin( TQObject *parent, const char *name, const TQStringList &args ) + : KFilePlugin( parent, name, args ) +{ + info = addMimeTypeInfo( "application/x-drgeo" ); + + KFileMimeTypeInfo::GroupInfo* group = addGroupInfo( info, "DrgeoInfo", i18n( "Summary" ) ); + KFileMimeTypeInfo::ItemInfo* item; + item = addItemInfo( group, "NumOfFigures", i18n( "Figures" ), TQVariant::Int ); + item = addItemInfo( group, "NumOfTexts", i18n( "Texts" ), TQVariant::Int ); + item = addItemInfo( group, "NumOfMacros", i18n( "Macros" ), TQVariant::Int ); + + group_contents = addGroupInfo( info, "DrgeoContents", i18n( "Translators: what this drgeo " + "file contains", "Contents" ) ); +} + +bool DrgeoPlugin::readInfo( KFileMetaInfo& metainfo, uint /*what*/ ) +{ + KFileMetaInfoGroup metagroup = appendGroup( metainfo, "DrgeoContents"); + + KFileMimeTypeInfo::ItemInfo* item; + + TQFile f( metainfo.path() ); + TQDomDocument doc( "drgenius" ); + if ( !doc.setContent( &f ) ) + return false; + TQDomElement main = doc.documentElement(); + int numfig = 0; + int numtext = 0; + int nummacro = 0; + TQString sectname; + // reading figures... + for ( TQDomNode n = main.firstChild(); ! n.isNull(); n = n.nextSibling() ) + { + TQDomElement e = n.toElement(); + if ( e.isNull() ) continue; + else if ( e.tagName() == "drgeo" ) + { + numfig++; + sectname = TQString( "Figure" ) + TQString::number( numfig ); + item = addItemInfo( group_contents, sectname, i18n( "Figure" ), TQVariant::String ); + appendItem( metagroup, sectname, e.attribute( "name" ) ); + } + else if ( e.tagName() == "text" ) + { + numtext++; + sectname = TQString( "Text" ) + TQString::number( numtext ); + item = addItemInfo( group_contents, sectname, i18n( "Text" ), TQVariant::String ); + appendItem( metagroup, sectname, e.attribute( "name" ) ); + } + else if ( e.tagName() == "macro" ) + { + nummacro++; + sectname = TQString( "Macro" ) + TQString::number( nummacro ); + item = addItemInfo( group_contents, sectname, i18n( "Macro" ), TQVariant::String ); + appendItem( metagroup, sectname, e.attribute( "name" ) ); + } + } + + metagroup = appendGroup( metainfo, "DrgeoInfo"); + appendItem( metagroup, "NumOfFigures", numfig ); + appendItem( metagroup, "NumOfTexts", numtext ); + appendItem( metagroup, "NumOfMacros", nummacro ); + + return true; +} + +#include "tdefile_drgeo.moc" + diff --git a/kig/tdefile/tdefile_drgeo.desktop b/kig/tdefile/tdefile_drgeo.desktop new file mode 100644 index 00000000..fc06ea50 --- /dev/null +++ b/kig/tdefile/tdefile_drgeo.desktop @@ -0,0 +1,55 @@ +[Desktop Entry] +Type=Service +Name=Dr. Geo Info +Name[af]=Dr. Geo inligting +Name[be]=Звесткі Dr. Geo +Name[bn]=ড. জিও সংক্রান্ত তথ্য +Name[br]=Titouroù diwar-benn Dr. Geo +Name[ca]=Informació Dr. Geo +Name[cs]=Dr. Geo info +Name[csb]=Wëdowiédzô Dr Geo +Name[cy]=Gwybodaeth Dr. Geo +Name[da]=Dr. Geo info +Name[el]=Πληροφορίες για το Dr. Geo +Name[eo]=Dr. Geo info +Name[es]=Información de Dr. Geo +Name[et]=Dr. Geo info +Name[eu]=Dr. Geo informazioa +Name[fa]=اطلاعات دکتر جیو +Name[fi]=Dr. Geo +Name[fr]=Informations de Dr. Geo +Name[ga]=Eolas faoi Dr. Geo +Name[gl]=Información de Dr. Geo +Name[he]=מידע על Dr. Geo +Name[hi]=डॉ. जिओ जानकारी +Name[hu]=Dr. Geo-jellemzők +Name[is]=Dr. Geo upplýsingar +Name[it]=Informazioni Dr. Geo +Name[ja]=Dr. Geo 情報 +Name[ka]=Dr. Geo - მონაცემები +Name[km]=ព័ត៌មាន Dr. Geo +Name[mk]=Dr. Geo инфо +Name[nb]=Dr. Geo-info +Name[ne]=डा. जिव जानकारी +Name[nn]=Dr. Geo-info +Name[pa]=Dr. Geo ਜਾਣਕਾਰੀ +Name[pl]=Informacja Dr. Geo +Name[pt]=Informação do Dr. Geo +Name[pt_BR]=Informações do Dr. Geo +Name[ru]=Файл Dr. Geo +Name[sl]=Podatki Dr. Geo +Name[sr]=Dr. Geo информације +Name[sr@Latn]=Dr. Geo informacije +Name[sv]=Dr. Geo-information +Name[ta]=டா. ஜியோ தகவல் +Name[tg]=Ахборот дар бораи Геометрия +Name[tr]=Dr. Geo Bilgisi +Name[uk]=Інформація для Dr. Geo +Name[vi]=Tiến sĩ Thông tin Hình học +Name[zh_CN]=Dr. Geo 信息 +Name[zh_TW]=Dr. Geo 資訊 +ServiceTypes=KFilePlugin +X-TDE-Library=tdefile_drgeo +MimeType=application/x-drgeo +PreferredGroups=DrgeoInfo +PreferredItems=NumOfFigures;NumOfTexts;NumOfMacros diff --git a/kig/tdefile/tdefile_drgeo.h b/kig/tdefile/tdefile_drgeo.h new file mode 100644 index 00000000..b9f0b52a --- /dev/null +++ b/kig/tdefile/tdefile_drgeo.h @@ -0,0 +1,42 @@ +/*************************************************************************** + * Copyright (C) 2004 by Pino Toscano * + * toscano.pino@tiscali.it * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef KIG_KFILE_KFILE_DRGEO_H +#define KIG_KFILE_KFILE_DRGEO_H + +#include + +class TQStringList; + +class DrgeoPlugin: public KFilePlugin +{ + Q_OBJECT + + +public: + DrgeoPlugin( TQObject *parent, const char *name, const TQStringList& args ); + + virtual bool readInfo( KFileMetaInfo& metainfo, uint what); +protected: + KFileMimeTypeInfo* info; + KFileMimeTypeInfo::GroupInfo* group_contents; +}; + +#endif diff --git a/kig/tdefile/tdefile_kig.cpp b/kig/tdefile/tdefile_kig.cpp new file mode 100644 index 00000000..48042368 --- /dev/null +++ b/kig/tdefile/tdefile_kig.cpp @@ -0,0 +1,153 @@ +/*************************************************************************** + * Copyright (C) 2004 by Pino Toscano * + * toscano.pino@tiscali.it * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#include "tdefile_kig.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +typedef KGenericFactory kigFactory; + +K_EXPORT_COMPONENT_FACTORY( tdefile_kig, kigFactory( "tdefile_kig" ) ) + +KigPlugin::KigPlugin( TQObject *parent, const char *name, const TQStringList &args ) + : KFilePlugin( parent, name, args ) +{ + KFileMimeTypeInfo::ItemInfo* item; + + info = addMimeTypeInfo( "application/x-kig" ); + + group = addGroupInfo( info, "KigInfo", i18n( "Summary" ) ); + item = addItemInfo( group, "Version", i18n( "Version" ), TQVariant::String ); + item = addItemInfo( group, "CompatVersion", i18n( "Compatibility Version" ), TQVariant::String ); + item = addItemInfo( group, "CoordSystem", i18n( "Coordinate System" ), TQVariant::String ); + item = addItemInfo( group, "Grid", i18n( "Grid" ), TQVariant::String ); + item = addItemInfo( group, "Axes", i18n( "Axes" ), TQVariant::String ); + item = addItemInfo( group, "Compressed", i18n( "Compressed" ), TQVariant::String ); +} + +bool KigPlugin::readInfo( KFileMetaInfo& metainfo, uint /*what*/ ) +{ + KFileMetaInfoGroup metagroup = appendGroup( metainfo, "KigInfo"); + + TQString sfile = metainfo.path(); + bool iscompressed = false; + TQFile f( sfile ); + if ( !sfile.endsWith( ".kig", false ) ) + { + iscompressed = true; + + TQString tempdir = TDEGlobal::dirs()->saveLocation( "tmp" ); + if ( tempdir.isEmpty() ) + return false; + + TQString tempname = sfile.section( '/', -1 ); + if ( sfile.endsWith( ".kigz", false ) ) + { + tempname.remove( TQRegExp( "\\.[Kk][Ii][Gg][Zz]$" ) ); + } + else + return false; + // reading compressed file + KTar* ark = new KTar( sfile, "application/x-gzip" ); + ark->open( IO_ReadOnly ); + const KArchiveDirectory* dir = ark->directory(); + TQStringList entries = dir->entries(); + TQStringList kigfiles = entries.grep( TQRegExp( "\\.kig$" ) ); + if ( kigfiles.count() != 1 ) + return false; + const KArchiveEntry* kigz = dir->entry( kigfiles[0] ); + if ( !kigz->isFile() ) + return false; + dynamic_cast( kigz )->copyTo( tempdir ); + + f.setName( tempdir + kigz->name() ); + } + + if ( !f.open( IO_ReadOnly ) ) + return false; + + TQDomDocument doc( "KigDocument" ); + if ( !doc.setContent( &f ) ) + return false; + + f.close(); + + // removing temp file + if ( iscompressed ) + f.remove(); + + TQDomElement main = doc.documentElement(); + + // reading the version... + TQString version = main.attribute( "Version" ); + if ( version.isEmpty() ) version = main.attribute( "version" ); + if ( version.isEmpty() ) version = i18n( "Translators: Not Available", "n/a" ); + appendItem( metagroup, "Version", version ); + + // reading the compatibility version... + TQString compatversion = main.attribute( "CompatibilityVersion" ); + if ( compatversion.isEmpty() ) + compatversion = i18n( "%1 represents Kig version", + "%1 (as the version)" ).arg( version ); + appendItem( metagroup, "CompatVersion", compatversion ); + + // reading the Coordinate System... + TQCString coordsystem; + for ( TQDomNode n = main.firstChild(); ! n.isNull(); n = n.nextSibling() ) + { + TQDomElement e = n.toElement(); + if ( e.isNull() ) continue; + if ( e.tagName() == "CoordinateSystem" ) + coordsystem = e.text().latin1(); + } + appendItem( metagroup, "CoordSystem", coordsystem ); + + // has Kig document the grid? + bool btmp = true; + TQString stmp = main.attribute( "grid" ); + if ( !( stmp.isEmpty() || ( stmp != "0" ) ) ) + btmp = ( stmp != "0" ); + TQString stmp2 = btmp ? i18n( "Yes" ) : i18n( "No" ); + appendItem( metagroup, "Grid", stmp2 ); + + // has Kig document the axes? + btmp = true; + stmp = main.attribute( "axes" ); + if ( !( stmp.isEmpty() || ( stmp != "0" ) ) ) + btmp = ( stmp != "0" ); + stmp2 = btmp ? i18n( "Yes" ) : i18n( "No" ); + appendItem( metagroup, "Axes", stmp2 ); + + stmp2 = iscompressed ? i18n( "Yes" ) : i18n( "No" ); + appendItem( metagroup, "Compressed", stmp2 ); + + return true; +} + +#include "tdefile_kig.moc" diff --git a/kig/tdefile/tdefile_kig.desktop b/kig/tdefile/tdefile_kig.desktop new file mode 100644 index 00000000..ac5597f8 --- /dev/null +++ b/kig/tdefile/tdefile_kig.desktop @@ -0,0 +1,54 @@ +[Desktop Entry] +Type=Service +Name=Kig Info +Name[af]=Kig inligting +Name[be]=Звесткі Kig +Name[bn]=কিগ সংক্রান্ত তথ্য +Name[br]=Titouroù diwar-benn Kig +Name[ca]=Informació Kig +Name[cs]=Kig info +Name[csb]=Wëdowiédzô Kig +Name[cy]=Gwybodaeth Kig +Name[da]=Kig info +Name[el]=Πληροφορίες για το Kig +Name[eo]=Kig info +Name[es]=Información de Kig +Name[et]=Kigi info +Name[eu]=Kig informazioa +Name[fa]=اطلاعات Kig +Name[fr]=Informations de Kig +Name[ga]=Eolas faoi Kig +Name[gl]=Información de Kig +Name[he]=Kig מידע +Name[hi]=केआईजी जानकारी +Name[hu]=Kig-jellemzők +Name[is]=Kig upplýsingar +Name[it]=Informazioni Kig +Name[ja]=Kig 情報 +Name[ka]=Kig - მონაცემები +Name[km]=ព័ត៌មាន Kig +Name[mk]=Kig инфо +Name[nb]=Kig-info +Name[ne]=किग जानकारी +Name[nn]=Kig-info +Name[pa]=ਕਿਗ ਜਾਣਕਾਰੀ +Name[pl]=Informacja Kig +Name[pt]=Informação do Kig +Name[pt_BR]=Informações do Kig +Name[ru]=Файл Kig +Name[sl]=Podatki Kig +Name[sr]=Kig информације +Name[sr@Latn]=Kig informacije +Name[sv]=Kig-information +Name[ta]=கிக் தகவல் +Name[tg]=Ахборот дар бораи Kig +Name[tr]=Kig Bilgisi +Name[uk]=Інформація для Kig +Name[vi]=Thông tin Kig +Name[zh_CN]=Kig 信息 +Name[zh_TW]=Kig 資訊 +ServiceTypes=KFilePlugin +X-TDE-Library=tdefile_kig +MimeType=application/x-kig +PreferredGroups=KigInfo +PreferredItems=Version;CoordSytem diff --git a/kig/tdefile/tdefile_kig.h b/kig/tdefile/tdefile_kig.h new file mode 100644 index 00000000..c910b33b --- /dev/null +++ b/kig/tdefile/tdefile_kig.h @@ -0,0 +1,42 @@ +/*************************************************************************** + * Copyright (C) 2004 by Pino Toscano * + * toscano.pino@tiscali.it * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef KIG_KFILE_KFILE_KIG_H +#define KIG_KFILE_KFILE_KIG_H + +#include + +class TQStringList; + +class KigPlugin: public KFilePlugin +{ + Q_OBJECT + + +public: + KigPlugin( TQObject *parent, const char *name, const TQStringList& args ); + + virtual bool readInfo( KFileMetaInfo& metainfo, uint what); +protected: + KFileMimeTypeInfo* info; + KFileMimeTypeInfo::GroupInfo* group; +}; + +#endif -- cgit v1.2.1