remove unused code relating to old unsupported version of libarchive
authorMichael Rasmussen <mir@datanom.net>
Fri, 14 Nov 2014 23:40:48 +0000 (00:40 +0100)
committerMichael Rasmussen <mir@datanom.net>
Fri, 14 Nov 2014 23:40:48 +0000 (00:40 +0100)
src/plugins/archive/archiver.c
src/plugins/archive/archiver.h
src/plugins/archive/archiver_gtk.c
src/plugins/archive/archiver_prefs.c
src/plugins/archive/archiver_prefs.h
src/plugins/archive/libarchive_archive.c
src/plugins/archive/libarchive_archive.h

index e4dd351..9d0c89e 100644 (file)
@@ -115,11 +115,7 @@ const gchar* plugin_name(void) {
        return PLUGIN_NAME;
 }
 
-#if NEW_ARCHIVE_API
 #define ARCHIVER_COMPRESS_FORMATS "\tGZIP/ZIP\n\tBZIP2\n\tCOMPRESS\n"
-#else
-#define ARCHIVER_COMPRESS_FORMATS "\tGZIP/ZIP\n\tBZIP2\n"
-#endif
 
 const gchar* plugin_desc(void) {
        if (plugin_description == NULL) {
index 9c30e05..61abab0 100644 (file)
@@ -46,9 +46,9 @@ struct ArchivePage {
        GtkWidget*      md5sum;
        GtkWidget*      rename_files;
        gboolean        cancelled;
-        GtkWidget*      isoDate;
-        gboolean        unlink;
-        GtkWidget*      unlink_files;
+    GtkWidget*  isoDate;
+    gboolean    unlink;
+    GtkWidget*  unlink_files;
 };
 
 void archiver_gtk_show();
index cc1c982..0bba669 100644 (file)
@@ -236,12 +236,10 @@ static COMPRESS_METHOD get_compress_method(GSList* btn) {
                                debug_print("BZIP2 compression enabled\n");
                                return BZIP2;
                        }
-#if NEW_ARCHIVE_API
-                        else if (strcmp("COMPRESS", name) == 0) {
+            else if (strcmp("COMPRESS", name) == 0) {
                                debug_print("COMPRESS compression enabled\n");
                                return COMPRESS;
                        }
-#endif
                        else if (strcmp("NONE", name) == 0) {
                                debug_print("Compression disabled\n");
                                return NO_COMPRESS;
@@ -679,11 +677,9 @@ static void show_result(struct ArchivePage* page) {
                case BZIP2:
                        method = g_strdup("BZIP2");
                        break;
-#if NEW_ARCHIVE_API
-                case COMPRESS:
+        case COMPRESS:
                        method = g_strdup("Compress");
                        break;
-#endif
                case NO_COMPRESS:
                        method = g_strdup("No Compression");
                        break;
@@ -972,9 +968,7 @@ void archiver_gtk_show() {
        GtkWidget* file_select;
        GtkWidget* zip_radio_btn;
        GtkWidget* bzip_radio_btn;
-#if NEW_ARCHIVE_API
-        GtkWidget* compress_radio_btn;
-#endif
+    GtkWidget* compress_radio_btn;
        GtkWidget* no_radio_btn;
        GtkWidget* shar_radio_btn;
        GtkWidget* pax_radio_btn;
@@ -1070,14 +1064,12 @@ void archiver_gtk_show() {
        CLAWS_SET_TIP(bzip_radio_btn,
                        _("Choose this option to use BZIP2 compression for the archive"));
 
-#if NEW_ARCHIVE_API
        compress_radio_btn = gtk_radio_button_new_with_mnemonic_from_widget(
                                        GTK_RADIO_BUTTON(zip_radio_btn), "Com_press");
        gtk_widget_set_name(compress_radio_btn, "COMPRESS");
        gtk_box_pack_start(GTK_BOX(hbox1), compress_radio_btn, FALSE, FALSE, 0);
        CLAWS_SET_TIP(compress_radio_btn,
                _("Choose this to use Compress compression for your archive"));
-#endif
 
        no_radio_btn = gtk_radio_button_new_with_mnemonic_from_widget(
                                        GTK_RADIO_BUTTON(zip_radio_btn), _("_None"));
@@ -1096,13 +1088,11 @@ void archiver_gtk_show() {
        case COMPRESSION_BZIP:
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bzip_radio_btn), TRUE);
                break;
-#if NEW_ARCHIVE_API
         case COMPRESSION_COMPRESS:
-                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(compress_radio_btn), TRUE);
+            gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(compress_radio_btn), TRUE);
                 break;
-#endif
-       case COMPRESSION_NONE:
-               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(no_radio_btn), TRUE);
+           case COMPRESSION_NONE:
+                   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(no_radio_btn), TRUE);
                break;
        }
 
index bc5ad64..76e00b0 100644 (file)
@@ -50,9 +50,7 @@ struct ArchiverPrefsPage {
        gint compression;
        GtkWidget *zip_radiobtn;
        GtkWidget *bzip_radiobtn;
-#if NEW_ARCHIVE_API
-        GtkWidget *compress_radiobtn;
-#endif
+    GtkWidget *compress_radiobtn;
        GtkWidget *none_radiobtn;
        GtkWidget *tar_radiobtn;
        GtkWidget *shar_radiobtn;
@@ -161,9 +159,7 @@ static void create_archiver_prefs_page(PrefsPage * _page,
        GSList    *compression_group = NULL;
        GtkWidget *zip_radiobtn;
        GtkWidget *bzip_radiobtn;
-#if NEW_ARCHIVE_API
-        GtkWidget *compress_radiobtn;
-#endif
+    GtkWidget *compress_radiobtn;
        GtkWidget *none_radiobtn;
        GSList    *format_group = NULL;
        GtkWidget *tar_radiobtn;
@@ -229,16 +225,14 @@ static void create_archiver_prefs_page(PrefsPage * _page,
        CLAWS_SET_TIP(bzip_radiobtn,
                        _("Choose this option to use BZIP2 compression by default"));
 
-#if NEW_ARCHIVE_API
        compress_radiobtn = gtk_radio_button_new_with_label(compression_group, "COMPRESS");
        compression_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(compress_radiobtn));
        gtk_widget_show(compress_radiobtn);
        gtk_box_pack_start(GTK_BOX (hbox1), compress_radiobtn, FALSE, FALSE, 0);
        CLAWS_SET_TIP(compress_radiobtn,
                        _("Choose this option to use COMPRESS compression by default"));
-#endif
 
-        none_radiobtn = gtk_radio_button_new_with_label(compression_group, _("None"));
+    none_radiobtn = gtk_radio_button_new_with_label(compression_group, _("None"));
        compression_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(none_radiobtn));
        gtk_widget_show(none_radiobtn);
        gtk_box_pack_start(GTK_BOX (hbox1), none_radiobtn, FALSE, FALSE, 0);
@@ -252,11 +246,9 @@ static void create_archiver_prefs_page(PrefsPage * _page,
        case COMPRESSION_BZIP:
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bzip_radiobtn), TRUE);
                break;
-#if NEW_ARCHIVE_API
-        case COMPRESSION_COMPRESS:       
+    case COMPRESSION_COMPRESS:       
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(compress_radiobtn), TRUE);
                break;
-#endif
        case COMPRESSION_NONE:
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(none_radiobtn), TRUE);
                break;
@@ -351,9 +343,7 @@ static void create_archiver_prefs_page(PrefsPage * _page,
        page->save_folder = save_folder;
        page->zip_radiobtn = zip_radiobtn;
        page->bzip_radiobtn = bzip_radiobtn;
-#if NEW_ARCHIVE_API
-        page->compress_radiobtn = compress_radiobtn;
-#endif
+    page->compress_radiobtn = compress_radiobtn;
        page->none_radiobtn = none_radiobtn;
        page->tar_radiobtn = tar_radiobtn;
        page->shar_radiobtn = shar_radiobtn;
@@ -384,10 +374,8 @@ static void save_archiver_prefs(PrefsPage * _page)
                archiver_prefs.compression = COMPRESSION_ZIP;
        else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->bzip_radiobtn)))
                archiver_prefs.compression = COMPRESSION_BZIP;
-#if NEW_ARCHIVE_API
        else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->compress_radiobtn)))
                archiver_prefs.compression = COMPRESSION_COMPRESS;
-#endif
        else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->none_radiobtn)))
                archiver_prefs.compression = COMPRESSION_NONE;
 
index 9a6b148..d5ec94a 100644 (file)
@@ -27,10 +27,8 @@ typedef struct _ArchiverPrefs        ArchiverPrefs;
 typedef enum {
        COMPRESSION_ZIP,
        COMPRESSION_BZIP,
-#if NEW_ARCHIVE_API
-        COMPRESSION_COMPRESS,
-#endif
-        COMPRESSION_NONE
+    COMPRESSION_COMPRESS,
+    COMPRESSION_NONE
 } CompressionType;
 
 typedef enum {
@@ -48,7 +46,7 @@ struct _ArchiverPrefs
        gint            recursive;
        gint            md5sum;
        gint            rename;
-        gint            unlink;
+    gint        unlink;
 };
 
 extern ArchiverPrefs archiver_prefs;
index acc13be..1da9450 100644 (file)
@@ -33,7 +33,7 @@
 #      include "archiver.h"
 #      include "utils.h"
 #      include "mainwindow.h"
-#       include "folder.h"
+#   include "folder.h"
 #endif
 
 #include <sys/types.h>
index bb76f9a..f33e4ad 100644 (file)
@@ -29,10 +29,8 @@ typedef enum _COMPRESS_METHOD COMPRESS_METHOD;
 enum _COMPRESS_METHOD {
                ZIP,
                BZIP2,
-#if NEW_ARCHIVE_API
-                COMPRESS,
-#endif
-                NO_COMPRESS
+        COMPRESS,
+        NO_COMPRESS
 };
 
 typedef enum _ARCHIVE_FORMAT ARCHIVE_FORMAT;