diff --git a/CMakeLists.txt b/CMakeLists.txt index c2512338..a2c3e663 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,275 +1,273 @@ cmake_minimum_required(VERSION 3.5) # KDE Application Version, managed by release script set(RELEASE_SERVICE_VERSION_MAJOR "20") set(RELEASE_SERVICE_VERSION_MINOR "04") set(RELEASE_SERVICE_VERSION_MICRO "1") set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}") project(kig VERSION ${RELEASE_SERVICE_VERSION}) find_package(Qt5Svg REQUIRED) find_package(Qt5PrintSupport REQUIRED) find_package(Qt5XmlPatterns 5.5.1) find_package(ECM 1.7 REQUIRED NO_MODULE) find_package(KF5Parts REQUIRED) find_package(KF5DocTools REQUIRED) find_package(KF5I18n REQUIRED) find_package(KF5TextEditor REQUIRED) find_package(KF5IconThemes REQUIRED) find_package(KF5ConfigWidgets REQUIRED) find_package(KF5Archive REQUIRED) find_package(KF5XmlGui 5.1 REQUIRED) find_package(KF5Crash 5.15 REQUIRED) find_package(KF5CoreAddons REQUIRED) set(CMAKE_MODULE_PATH ${kig_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH}) set (KDE5_ICON_DIR ${CMAKE_INSTALL_PREFIX}/share/icons) include(ECMAddAppIcon) include(ECMInstallIcons) include(ECMAddTests) include(KDEInstallDirs) include(KDECompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) include(FeatureSummary) include(GenerateExportHeader) include(ECMSetupVersion) ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KIG VERSION_HEADER kig_version.h) add_definitions (-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS) include_directories (${Qt5Gui_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE5_INCLUDES}) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif() include(KigConfigureChecks.cmake) find_package(BoostPython) add_subdirectory( doc ) add_subdirectory( icons ) add_subdirectory( kig ) add_subdirectory( mimetypes ) add_subdirectory( macros ) -# reenable after porting kig's kkfile plugns to the strigi api -#add_subdirectory( kfile ) add_subdirectory( data ) add_subdirectory( pykig ) if(BoostPython_FOUND) add_subdirectory( scripting ) add_definitions(-DKIG_ENABLE_PYTHON_SCRIPTING) endif(BoostPython_FOUND) set_package_properties( BoostPython PROPERTIES DESCRIPTION "Python scripting support in Boost" URL "https://www.boost.org/" TYPE OPTIONAL PURPOSE "Kig can optionally use Boost.Python for Python scripting" ) set_package_properties( Qt5XmlPatterns PROPERTIES DESCRIPTION "Qt5 XmlPatterns Module" URL "https://qt.io/" TYPE OPTIONAL PURPOSE "Kig uses the XML Patterns module in Qt to support Geogebra files" ) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) include_directories( ${CMAKE_SOURCE_DIR}/modes ) if(BoostPython_FOUND) include_directories(${BoostPython_INCLUDE_DIRS}) endif(BoostPython_FOUND) # kigpart set(kigpart_PART_SRCS objects/angle_type.cc objects/arc_type.cc objects/base_type.cc objects/bogus_imp.cc objects/centerofcurvature_type.cc objects/circle_imp.cc objects/circle_type.cc objects/common.cc objects/conic_imp.cc objects/conic_types.cc objects/cubic_imp.cc objects/cubic_type.cc objects/curve_imp.cc objects/intersection_types.cc objects/inversion_type.cc objects/line_imp.cc objects/line_type.cc objects/locus_imp.cc objects/object_calcer.cc objects/object_drawer.cc objects/object_factory.cc objects/object_holder.cc objects/object_imp.cc objects/object_imp_factory.cc objects/object_type.cc objects/object_type_factory.cc objects/other_imp.cc objects/other_type.cc objects/point_imp.cc objects/point_type.cc objects/polygon_imp.cc objects/polygon_type.cc objects/bezier_imp.cc objects/bezier_type.cc objects/special_imptypes.cc objects/tangent_type.cc objects/tests_type.cc objects/text_imp.cc objects/text_type.cc objects/transform_types.cc objects/vector_type.cc misc/argsparser.cpp misc/builtin_stuff.cc misc/calcpaths.cc misc/common.cpp misc/conic-common.cpp misc/coordinate.cpp misc/coordinate_system.cpp misc/cubic-common.cc misc/equationstring.cc misc/goniometry.cc misc/guiaction.cc misc/kigcoordinateprecisiondialog.cpp misc/kigfiledialog.cc misc/kiginputdialog.cc misc/kignumerics.cpp misc/kigpainter.cpp misc/kigtransform.cpp misc/lists.cc misc/object_constructor.cc misc/object_hierarchy.cc misc/rect.cc misc/screeninfo.cc misc/special_constructors.cc misc/unit.cc modes/base_mode.cc modes/construct_mode.cc modes/dragrectmode.cc modes/edittype.cc modes/historydialog.cc modes/label.cc modes/linkslabel.cpp modes/macro.cc modes/macrowizard.cc modes/mode.cc modes/moving.cc modes/normal.cc modes/popup/popup.cc modes/popup/objectchooserpopup.cc modes/popup/propertiesactionsprovider.cc modes/popup/objectchooserpopup.cc modes/popup/objecttypeactionsprovider.cc modes/popup/nameobjectactionsprovider.cc modes/popup/objectconstructoractionsprovider.cc modes/popup/builtindocumentactionsprovider.cc modes/popup/builtinobjectactionsprovider.cc modes/textlabelwizard.cc modes/typesdialog.cpp filters/asyexporter.cc filters/asyexporteroptions.cc filters/asyexporterimpvisitor.cc filters/cabri-filter.cc filters/cabri-utils.cc filters/drgeo-filter.cc filters/exporter.cc filters/filter.cc filters/filters-common.cc filters/imageexporteroptions.cc filters/kgeo-filter.cc filters/kseg-filter.cc filters/latexexporter.cc filters/latexexporteroptions.cc filters/native-filter.cc filters/pgfexporterimpvisitor.cc filters/svgexporter.cc filters/svgexporteroptions.cc filters/xfigexporter.cc kig/kig_commands.cpp kig/kig_document.cc kig/kig_part.cpp kig/kig_view.cpp ) if (Qt5XmlPatterns_FOUND) set(kigpart_PART_SRCS ${kigpart_PART_SRCS} geogebra/geogebratransformer.cpp geogebra/geogebrasection.cpp filters/geogebra-filter.cpp) qt5_add_resources(kigpart_PART_SRCS ${CMAKE_SOURCE_DIR}/geogebra/geogebra.qrc) add_definitions(-DWITH_GEOGEBRA=1) endif(Qt5XmlPatterns_FOUND) ki18n_wrap_ui(kigpart_PART_SRCS modes/typeswidget.ui modes/edittypewidget.ui modes/historywidget.ui filters/asyexporteroptionswidget.ui filters/imageexporteroptionswidget.ui filters/latexexporteroptionswidget.ui filters/svgexporteroptionswidget.ui misc/kigcoordinateprecisiondialog.ui ) if(BoostPython_FOUND) set(kigpart_PART_SRCS ${kigpart_PART_SRCS} modes/popup/scriptactionsprovider.cc scripting/newscriptwizard.cc scripting/python_scripter.cc scripting/python_type.cc scripting/script-common.cc scripting/script_mode.cc ) kde_source_files_enable_exceptions(scripting/python_scripter.cc) endif(BoostPython_FOUND) add_library(kigpart MODULE ${kigpart_PART_SRCS}) generate_export_header(kigpart) target_link_libraries(kigpart Qt5::Gui Qt5::Svg Qt5::PrintSupport KF5::Crash KF5::Parts KF5::I18n KF5::TextEditor KF5::IconThemes KF5::ConfigWidgets KF5::Archive ${KDE5_KUTILS_LIBS} ) if(BoostPython_FOUND) target_link_libraries(kigpart ${BoostPython_LIBRARIES} ${KDE5_KTEXTEDITOR_LIBS}) endif(BoostPython_FOUND) if (Qt5XmlPatterns_FOUND) target_link_libraries(kigpart Qt5::XmlPatterns) endif(Qt5XmlPatterns_FOUND) install(TARGETS kigpart DESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES org.kde.kig.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) # unit tests if (BUILD_TESTING) add_subdirectory(tests) endif () diff --git a/Messages.sh b/Messages.sh index 729ab008..51ca549e 100644 --- a/Messages.sh +++ b/Messages.sh @@ -1,14 +1,12 @@ #! /bin/sh $EXTRACTRC */*.rc >> rc.cpp || exit 11 $EXTRACTRC */*.ui >> rc.cpp || exit 12 (cd data && $PREPARETIPS > ../tips.cpp) for file in macros/*.kigt; do cat "$file" | grep '' | sed -e 's/^ *\([^<]*\)<\/Name>/i18n( "\1" );/' | sed -e 's/&/\&/g' >> rc.cpp cat "$file" | grep '' | sed -e 's/^ *\([^<]*\)<\/Description>/i18n( "\1" );/' | sed -e 's/&/\&/g' >> rc.cpp cat "$file" | grep '' | sed -e 's/^ *\([^<]*\)<\/UseText>/i18n( "\1" );/' | sed -e 's/&/\&/g' >> rc.cpp cat "$file" | grep '' | sed -e 's/^ *\([^<]*\)<\/SelectStatement>/i18n( "\1" );/' | sed -e 's/&/\&/g' >> rc.cpp done -$XGETTEXT tips.cpp rc.cpp $(find . -name "*.cpp" -o -name "*.h" -o -name "*.cc" | grep -v \./kfile/) -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 tips.cpp rc.cpp $(find . -name "*.cpp" -o -name "*.h" -o -name "*.cc") -o $podir/kig.pot rm -f tips.cpp diff --git a/kfile/CMakeLists.txt b/kfile/CMakeLists.txt deleted file mode 100644 index 80e181a8..00000000 --- a/kfile/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -set(kfile_drgeo_PART_SRCS kfile_drgeo.cpp ) -add_library(kfile_drgeo ${kfile_drgeo_PART_SRCS} MODULE) -target_link_libraries(kfile_drgeo KF5::KIO ${QT_QTXML_LIBRARY} ) -install(TARGETS kfile_drgeo DESTINATION ${PLUGIN_INSTALL_DIR}) - -set(kfile_kig_PART_SRCS kfile_kig.cpp ) -add_library(kfile_kig ${kfile_kig_PART_SRCS} MODULE) -add_library(kfile_kig KF5::KIO ${QT_QTXML_LIBRARY} ) -install(TARGETS kfile_kig DESTINATION ${PLUGIN_INSTALL_DIR}) - - -########### install files ############### - -install(FILES - kfile_drgeo.desktop - kfile_kig.desktop - DESTINATION ${SERVICES_INSTALL_DIR}) - diff --git a/kfile/kfile_drgeo.cpp b/kfile/kfile_drgeo.cpp deleted file mode 100644 index 55715eaa..00000000 --- a/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( QObject *parent, const QStringList &args ) - : KFilePlugin( parent, args ) -{ - info = addMimeTypeInfo( "application/x-drgeo" ); - - KFileMimeTypeInfo::GroupInfo* group = addGroupInfo( info, "DrgeoInfo", i18n( "Summary" ) ); - KFileMimeTypeInfo::ItemInfo* item; - item = addItemInfo( group, "NumOfFigures", i18n( "Figures" ), QVariant::Int ); - item = addItemInfo( group, "NumOfTexts", i18n( "Texts" ), QVariant::Int ); - item = addItemInfo( group, "NumOfMacros", i18n( "Macros" ), QVariant::Int ); - - group_contents = addGroupInfo( info, "DrgeoContents", i18nc( "Translators: what this drgeo " - "file contains", "Contents" ) ); -} - -bool DrgeoPlugin::readInfo( KFileMetaInfo& metainfo, uint /*what*/ ) -{ - KFileMetaInfoGroup metagroup = appendGroup( metainfo, "DrgeoContents"); - - KFileMimeTypeInfo::ItemInfo* item; - - QFile f( metainfo.path() ); - QDomDocument doc( "drgenius" ); - if ( !doc.setContent( &f ) ) - return false; - QDomElement main = doc.documentElement(); - int numfig = 0; - int numtext = 0; - int nummacro = 0; - QString sectname; - // reading figures... - for ( QDomNode n = main.firstChild(); ! n.isNull(); n = n.nextSibling() ) - { - QDomElement e = n.toElement(); - if ( e.isNull() ) continue; - else if ( e.tagName() == "drgeo" ) - { - numfig++; - sectname = QString( "Figure" ) + QString::number( numfig ); - item = addItemInfo( group_contents, sectname, i18n( "Figure" ), QVariant::String ); - appendItem( metagroup, sectname, e.attribute( "name" ) ); - } - else if ( e.tagName() == "text" ) - { - numtext++; - sectname = QString( "Text" ) + QString::number( numtext ); - item = addItemInfo( group_contents, sectname, i18n( "Text" ), QVariant::String ); - appendItem( metagroup, sectname, e.attribute( "name" ) ); - } - else if ( e.tagName() == "macro" ) - { - nummacro++; - sectname = QString( "Macro" ) + QString::number( nummacro ); - item = addItemInfo( group_contents, sectname, i18n( "Macro" ), QVariant::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; -} - - - diff --git a/kfile/kfile_drgeo.desktop b/kfile/kfile_drgeo.desktop deleted file mode 100644 index e6c2e543..00000000 --- a/kfile/kfile_drgeo.desktop +++ /dev/null @@ -1,73 +0,0 @@ -[Desktop Entry] -Type=Service -Name=Dr. Geo Info -Name[af]=Dr. Geo inligting -Name[be]=Звесткі Dr. Geo -Name[bg]=Dr. Geo Info -Name[bn]=ড. জিও সংক্রান্ত তথ্য -Name[br]=Titouroù diwar-benn Dr. Geo -Name[bs]=Dr. Geo Informacije -Name[ca]=Informació Dr. Geo -Name[ca@valencia]=Informació Dr. Geo -Name[cs]=Informace o programu Dr. Geo -Name[csb]=Wëdowiédzô Dr Geo -Name[cy]=Gwybodaeth Dr. Geo -Name[da]=Dr. Geo info -Name[de]=Dr. Geo Info -Name[el]=Πληροφορίες για το Dr. Geo -Name[en_GB]=Dr. Geo Info -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 -tiedot -Name[fr]=Informations pour Dr. Geo -Name[ga]=Eolas faoi Dr. Geo -Name[gl]=Información de Dr. Geo -Name[gu]=Dr. Geo માહિતી -Name[he]=מידע על Dr. Geo -Name[hi]=डॉ. जिओ जानकारी -Name[hne]=डा. जिओ जानकारी -Name[hr]=Dr. Geo Info -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[kk]=Dr. Geo ақпары -Name[km]=ព័ត៌មាន Dr. Geo -Name[ko]=Dr. Geo 정보 -Name[lt]=Dr. Geo Info -Name[lv]=Dr. Geo Info -Name[mk]=Dr. Geo инфо -Name[ml]=Dr. ജിയോ വിവരം -Name[mr]=डॉ. जिओ माहिती -Name[ms]=Dr. Geo Info -Name[nb]=Dr. Geo-info -Name[nds]=Dr. Geo Info -Name[ne]=डा. भूगोल जानकारी -Name[nl]=Dr. Geo Info -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[sk]=Dr. Geo Info -Name[sl]=Podatki Dr. Geo -Name[sv]=Dr. Geo-information -Name[ta]=டா. ஜியோ தகவல் -Name[tg]=Ахборот дар бораи Геометрия -Name[tr]=Dr. Geo Bilgisi -Name[ug]=Dr. Geo ئۇچۇرى -Name[uk]=Інформація для Dr. Geo -Name[vi]=Tiến sĩ Thông tin Hình học -Name[x-test]=xxDr. Geo Infoxx -Name[zh_CN]=Dr. Geo 信息 -Name[zh_TW]=Dr. Geo 資訊 -X-KDE-ServiceTypes=KFilePlugin -X-KDE-Library=kfile_drgeo -MimeType=application/x-drgeo; -PreferredGroups=DrgeoInfo -PreferredItems=NumOfFigures;NumOfTexts;NumOfMacros diff --git a/kfile/kfile_drgeo.h b/kfile/kfile_drgeo.h deleted file mode 100644 index fc860464..00000000 --- a/kfile/kfile_drgeo.h +++ /dev/null @@ -1,41 +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 QStringList; - -class DrgeoPlugin: public KFilePlugin -{ - Q_OBJECT - -public: - DrgeoPlugin( QObject *parent, const QStringList& args ); - - virtual bool readInfo( KFileMetaInfo& metainfo, uint what); -protected: - KFileMimeTypeInfo* info; - KFileMimeTypeInfo::GroupInfo* group_contents; -}; - -#endif diff --git a/kfile/kfile_kig.cpp b/kfile/kfile_kig.cpp deleted file mode 100644 index 76a780cd..00000000 --- a/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( QObject *parent, const QStringList &args ) - : KFilePlugin( parent, args ) -{ - KFileMimeTypeInfo::ItemInfo* item; - - info = addMimeTypeInfo( "application/x-kig" ); - - group = addGroupInfo( info, "KigInfo", i18n( "Summary" ) ); - item = addItemInfo( group, "Version", i18n( "Version" ), QVariant::String ); - item = addItemInfo( group, "CompatVersion", i18n( "Compatibility Version" ), QVariant::String ); - item = addItemInfo( group, "CoordSystem", i18n( "Coordinate System" ), QVariant::String ); - item = addItemInfo( group, "Grid", i18n( "Grid" ), QVariant::String ); - item = addItemInfo( group, "Axes", i18n( "Axes" ), QVariant::String ); - item = addItemInfo( group, "Compressed", i18n( "Compressed" ), QVariant::String ); -} - -bool KigPlugin::readInfo( KFileMetaInfo& metainfo, uint /*what*/ ) -{ - KFileMetaInfoGroup metagroup = appendGroup( metainfo, "KigInfo"); - - QString sfile = metainfo.path(); - bool iscompressed = false; - QFile f( sfile ); - if ( !sfile.endsWith( QLatin1String(".kig"), Qt::CaseInsensitive ) ) - { - iscompressed = true; - - QString tempdir = KGlobal::dirs()->saveLocation( "tmp" ); - if ( tempdir.isEmpty() ) - return false; - - QString tempname = sfile.section( '/', -1 ); - if ( sfile.endsWith( QLatin1String(".kigz"), Qt::CaseInsensitive ) ) - { - tempname.remove( QRegExp( "\\.[Kk][Ii][Gg][Zz]$" ) ); - } - else - return false; - // reading compressed file - KTar* ark = new KTar( sfile, "application/x-gzip" ); - ark->open( QIODevice::ReadOnly ); - const KArchiveDirectory* dir = ark->directory(); - QStringList entries = dir->entries(); - QStringList kigfiles = entries.filter( QRegExp( "\\.kig$" ) ); - if ( kigfiles.count() != 1 ) - return false; - const KArchiveEntry* kigz = dir->entry( kigfiles.at( 0 ) ); - if ( !kigz->isFile() ) - return false; - dynamic_cast( kigz )->copyTo( tempdir ); - - f.setFileName( tempdir + kigz->name() ); - } - - if ( !f.open( QIODevice::ReadOnly ) ) - return false; - - QDomDocument doc( "KigDocument" ); - if ( !doc.setContent( &f ) ) - return false; - - f.close(); - - // removing temp file - if ( iscompressed ) - f.remove(); - - QDomElement main = doc.documentElement(); - - // reading the version... - QString version = main.attribute( "Version" ); - if ( version.isEmpty() ) version = main.attribute( "version" ); - if ( version.isEmpty() ) version = i18nc( "Translators: Not Available", "n/a" ); - appendItem( metagroup, "Version", version ); - - // reading the compatibility version... - QString compatversion = main.attribute( "CompatibilityVersion" ); - if ( compatversion.isEmpty() ) - compatversion = i18nc( "%1 represents Kig version", - "%1 (as the version)", version ); - appendItem( metagroup, "CompatVersion", compatversion ); - - // reading the Coordinate System... - QByteArray coordsystem; - for ( QDomNode n = main.firstChild(); ! n.isNull(); n = n.nextSibling() ) - { - QDomElement e = n.toElement(); - if ( e.isNull() ) continue; - if ( e.tagName() == "CoordinateSystem" ) - coordsystem = e.text().toLatin1(); - } - appendItem( metagroup, "CoordSystem", coordsystem ); - - // has Kig document the grid? - bool btmp = true; - QString stmp = main.attribute( "grid" ); - if ( !( stmp.isEmpty() || ( stmp != "0" ) ) ) - btmp = ( stmp != "0" ); - QString 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; -} - - diff --git a/kfile/kfile_kig.desktop b/kfile/kfile_kig.desktop deleted file mode 100644 index 256cf439..00000000 --- a/kfile/kfile_kig.desktop +++ /dev/null @@ -1,73 +0,0 @@ -[Desktop Entry] -Type=Service -Name=Kig Info -Name[af]=Kig inligting -Name[be]=Звесткі Kig -Name[bg]=Kig Info -Name[bn]=কিগ সংক্রান্ত তথ্য -Name[br]=Titouroù diwar-benn Kig -Name[bs]=Kig Informacije -Name[ca]=Informació Kig -Name[ca@valencia]=Informació Kig -Name[cs]=Informace o programu Kig -Name[csb]=Wëdowiédzô Kig -Name[cy]=Gwybodaeth Kig -Name[da]=Kig-info -Name[de]=Kig Info -Name[el]=Πληροφορίες για το Kig -Name[en_GB]=Kig Info -Name[eo]=Kig Info -Name[es]=Información de Kig -Name[et]=Kigi info -Name[eu]=Kig informazioa -Name[fa]=اطلاعات Kig -Name[fi]=Kig-tiedot -Name[fr]=Informations pour Kig -Name[ga]=Eolas faoi Kig -Name[gl]=Información de Kig -Name[gu]=Kig માહિતી -Name[he]=Kig מידע -Name[hi]=आईजी जानकारी -Name[hne]=आईजी जानकारी -Name[hr]=Kig Info -Name[hu]=Kig-jellemzők -Name[is]=Kig upplýsingar -Name[it]=Informazioni Kig -Name[ja]=Kig 情報 -Name[ka]=Kig - მონაცემები -Name[kk]=Kig ақпары -Name[km]=ព័ត៌មាន Kig -Name[ko]=Kig 정보 -Name[lt]=Kig Info -Name[lv]=Kig informācija -Name[mk]=Kig инфо -Name[ml]=കിഗ് വിവരം -Name[mr]=किग माहिती -Name[ms]=Kig Info -Name[nb]=Kig-info -Name[nds]=Kig Info -Name[ne]=किग जानकारी -Name[nl]=Kig Info -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[sk]=Kig Info -Name[sl]=Podatki Kig -Name[sv]=Kig-information -Name[ta]=கிக் தகவல் -Name[tg]=Ахборот дар бораи Kig -Name[tr]=Kig Bilgisi -Name[ug]=Kig ئۇچۇرى -Name[uk]=Інформація для Kig -Name[vi]=Thông tin Kig -Name[x-test]=xxKig Infoxx -Name[zh_CN]=Kig 信息 -Name[zh_TW]=Kig 資訊 -X-KDE-ServiceTypes=KFilePlugin -X-KDE-Library=kfile_kig -MimeType=application/x-kig; -PreferredGroups=KigInfo -PreferredItems=Version;CoordSytem diff --git a/kfile/kfile_kig.h b/kfile/kfile_kig.h deleted file mode 100644 index 2d01902c..00000000 --- a/kfile/kfile_kig.h +++ /dev/null @@ -1,41 +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 QStringList; - -class KigPlugin: public KFilePlugin -{ - Q_OBJECT - -public: - KigPlugin( QObject *parent, const QStringList& args ); - - virtual bool readInfo( KFileMetaInfo& metainfo, uint what); -protected: - KFileMimeTypeInfo* info; - KFileMimeTypeInfo::GroupInfo* group; -}; - -#endif