Commit 9e1b6970 authored by Henrique Pinto's avatar Henrique Pinto
Browse files

* put all archive-related code in a separate library

svn path=/branches/work/libarchive-based-ark/ark/; revision=686478
parent bdda3cb7
......@@ -25,27 +25,14 @@ install(TARGETS ark DESTINATION ${BIN_INSTALL_DIR} )
########### next target ###############
set(arkpart_PART_SRCS ${libark_common_SRCS}
ark_part.cpp
arkfactory.cpp
filelistview.cpp
arkutils.cpp
archiveformatdlg.cpp
arkwidget.cpp
arkviewer.cpp
extractiondialog.cpp
arch.cpp
archiveinterface.cpp
libarchivehandler.cpp
jobs.cpp
archivebase.cpp
#tar.cpp
#zip.cpp
#lha.cpp
#compressedfile.cpp
#zoo.cpp
#rar.cpp
#ar.cpp
#sevenzip.cpp
ark_part.cpp
arkfactory.cpp
filelistview.cpp
arkutils.cpp
archiveformatdlg.cpp
arkwidget.cpp
arkviewer.cpp
extractiondialog.cpp
)
kde4_add_ui_files(arkpart_PART_SRCS general.ui )
......@@ -53,7 +40,7 @@ kde4_add_ui_files(arkpart_PART_SRCS general.ui )
kde4_add_plugin(arkpart WITH_PREFIX ${arkpart_PART_SRCS})
target_link_libraries(arkpart ${KDE4_KFILE_LIBS} ${KDE4_THREADWEAVER_LIBRARIES} ${LIBARCHIVE_LIBRARY} ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${KDE4_KPARTS_LIBS})
target_link_libraries(arkpart kerfuffle ${KDE4_KFILE_LIBS} ${KDE4_THREADWEAVER_LIBRARIES} ${LIBARCHIVE_LIBRARY} ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${KDE4_KPARTS_LIBS})
install(TARGETS arkpart DESTINATION ${PLUGIN_INSTALL_DIR})
......@@ -65,8 +52,7 @@ install( FILES ark.kcfg DESTINATION ${KCFG_INSTALL_DIR})
install( FILES ark_part.desktop DESTINATION ${SERVICES_INSTALL_DIR})
install( FILES arkui.rc ark_part.rc ark_part_readonly.rc DESTINATION ${DATA_INSTALL_DIR}/ark)
kde4_install_icons( ${ICON_INSTALL_DIR} )
kde4_install_icons( ${ICON_INSTALL_DIR} )
#add_subdirectory( plugins )
add_subdirectory( kerfuffle )
......@@ -21,7 +21,7 @@
#include "archiveformatdlg.h"
#include "archiveformatinfo.h"
#include "arch.h"
#include "kerfuffle/arch.h"
#include <KLocale>
#include <KVBox>
......
......@@ -23,7 +23,7 @@
#ifndef ARCHIVEFORMATINFO_H
#define ARCHIVEFORMATINFO_H
#include "arch.h"
#include "kerfuffle/arch.h"
#include <KMimeType>
class ArchiveFormatInfo
......
......@@ -36,7 +36,7 @@
#include <QDragMoveEvent>
#include <QDropEvent>
#include "arch.h"
#include "kerfuffle/arch.h"
#include "ui_general.h"
class KTreeWidgetSearchLine;
......
......@@ -33,7 +33,7 @@
#include <kio/global.h>
#include "arch.h"
#include "kerfuffle/arch.h"
class QString;
class QStringList;
......
ADD_DEFINITIONS(-D_LARGEFILE64_SOURCE)
set(libark_common_SRCS ../archiveformatinfo.cpp )
kde4_add_kcfg_files(libark_common_SRCS ../settings.kcfgc)
########### next target ###############
set(kerfuffle_SRCS ${libark_common_SRCS}
arch.cpp
archiveinterface.cpp
libarchivehandler.cpp
jobs.cpp
archivebase.cpp
)
kde4_add_library(kerfuffle SHARED ${kerfuffle_SRCS})
target_link_libraries(kerfuffle ${KDE4_KFILE_LIBS} ${KDE4_THREADWEAVER_LIBRARIES} ${LIBARCHIVE_LIBRARY} ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${KDE4_KPARTS_LIBS})
set_target_properties(kerfuffle PROPERTIES VERSION 1.0.0 SOVERSION 1 )
install(TARGETS kerfuffle DESTINATION ${LIB_INSTALL_DIR} )
......@@ -27,11 +27,9 @@
// ark includes
#include "arch.h"
#include "archivebase.h"
#include "arkutils.h"
// C includes
#include <stdlib.h>
#include <time.h>
#include <cstdlib>
// QT includes
#include <QApplication>
......
......@@ -36,6 +36,8 @@
#include <KUrl>
#include "kerfuffle_export.h"
class QStringList;
class ArkWidget;
......@@ -55,7 +57,7 @@ typedef QList< QPair< QString, Qt::AlignmentFlag > > ColumnList;
* Pure virtual base class for archives - provides a framework as well as
* useful common functionality.
*/
class Arch : public QObject
class KERFUFFLE_EXPORT Arch : public QObject
{
Q_OBJECT
......
......@@ -31,6 +31,7 @@
#include <QString>
#include "arch.h"
#include "kerfuffle_export.h"
class ArchiveObserver
{
......@@ -43,7 +44,7 @@ class ArchiveObserver
virtual void onProgress( double ) = 0;
};
class ReadOnlyArchiveInterface: public QObject
class KERFUFFLE_EXPORT ReadOnlyArchiveInterface: public QObject
{
Q_OBJECT
public:
......@@ -53,8 +54,8 @@ class ReadOnlyArchiveInterface: public QObject
QString filename() const { return m_filename; }
virtual bool isReadOnly() const { return true; }
void registerObserver( ArchiveObserver *observer );
void removeObserver( ArchiveObserver *observer );
void KDE_NO_EXPORT registerObserver( ArchiveObserver *observer );
void KDE_NO_EXPORT removeObserver( ArchiveObserver *observer );
virtual bool open() { return true; }
virtual bool list() = 0;
......
/***************************************************************************
* Copyright (C) 2006 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. *
***************************************************************************/
#ifndef KERFUFFLE_EXPORT_H
#define KERFUFFLE_EXPORT_H
/* needed for KDE_EXPORT macros */
#include <kdemacros.h>
#if defined _WIN32 || defined _WIN64
#ifndef KERFUFFLE_EXPORT
# ifdef MAKE_KERFUFFLE_LIB
# define KERFUFFLE_EXPORT KDE_EXPORT
# else
# define KERFUFFLE_EXPORT KDE_IMPORT
# endif
#endif
#else /* UNIX*/
/* export statements for unix */
#define KERFUFFLE_EXPORT KDE_EXPORT
#endif
#endif
......@@ -43,7 +43,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <KLocale>
// ark includes
#include "arch.h"
#include "kerfuffle/arch.h"
#include "arkapp.h"
extern "C" KDE_EXPORT int kdemain( int argc, char *argv[] )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment