Merge lp:~ballogy/gloobus-preview/drop-icns into lp:gloobus-preview

Proposed by Balló György
Status: Merged
Merged at revision: 306
Proposed branch: lp:~ballogy/gloobus-preview/drop-icns
Merge into: lp:gloobus-preview
Diff against target: 189 lines (+0/-141)
6 files modified
configure.ac (+0/-1)
src/Makefile.am (+0/-1)
src/gloobus-preview-plugin-manager.cpp (+0/-1)
src/plugin-icns/Makefile.am (+0/-10)
src/plugin-icns/plugin-icns.cpp (+0/-84)
src/plugin-icns/plugin-icns.h (+0/-44)
To merge this branch: bzr merge lp:~ballogy/gloobus-preview/drop-icns
Reviewer Review Type Date Requested Status
Gloobus Developers Pending
Review via email: mp+245374@code.launchpad.net

Description of the change

Remove icns plugin

It's replaced by the imagemagick plugin, which supports much more image formats.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2014-12-25 16:27:26 +0000
+++ configure.ac 2014-12-26 04:39:04 +0000
@@ -81,7 +81,6 @@
81 src/plugin-folder/Makefile81 src/plugin-folder/Makefile
82 src/plugin-compressed/Makefile82 src/plugin-compressed/Makefile
83 src/plugin-djvu/Makefile83 src/plugin-djvu/Makefile
84 src/plugin-icns/Makefile
85 src/plugin-gstreamer-audio/Makefile84 src/plugin-gstreamer-audio/Makefile
86 src/plugin-gstreamer-video/Makefile85 src/plugin-gstreamer-video/Makefile
87 src/plugin-pdf/Makefile86 src/plugin-pdf/Makefile
8887
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2014-12-25 16:27:26 +0000
+++ src/Makefile.am 2014-12-26 04:39:04 +0000
@@ -6,7 +6,6 @@
6 plugin-folder \6 plugin-folder \
7 plugin-compressed \7 plugin-compressed \
8 plugin-djvu \8 plugin-djvu \
9 plugin-icns \
10 plugin-gstreamer-audio \9 plugin-gstreamer-audio \
11 plugin-gstreamer-video \10 plugin-gstreamer-video \
12 plugin-pdf \11 plugin-pdf \
1312
=== modified file 'src/gloobus-preview-plugin-manager.cpp'
--- src/gloobus-preview-plugin-manager.cpp 2014-12-25 16:21:13 +0000
+++ src/gloobus-preview-plugin-manager.cpp 2014-12-26 04:39:04 +0000
@@ -100,7 +100,6 @@
100#include "plugin-folder/plugin-folder.h"100#include "plugin-folder/plugin-folder.h"
101#include "plugin-gstreamer-audio/plugin-gstreamer-audio.h"101#include "plugin-gstreamer-audio/plugin-gstreamer-audio.h"
102#include "plugin-gstreamer-video/plugin-gstreamer-video.h"102#include "plugin-gstreamer-video/plugin-gstreamer-video.h"
103#include "plugin-icns/plugin-icns.h"
104#include "plugin-pdf/office-plugin.h"103#include "plugin-pdf/office-plugin.h"
105#include "plugin-pdf/pdf-plugin.h"104#include "plugin-pdf/pdf-plugin.h"
106#include "plugin-pixbuf/plugin-pixbuf.h"105#include "plugin-pixbuf/plugin-pixbuf.h"
107106
=== removed directory 'src/plugin-icns'
=== removed file 'src/plugin-icns/Makefile.am'
--- src/plugin-icns/Makefile.am 2010-01-24 20:25:39 +0000
+++ src/plugin-icns/Makefile.am 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
1plugindir = $(prefix)/lib/gloobus/
2
3AM_CPPFLAGS += $(GTK_CFLAGS)
4AM_LDFLAGS = $(GTK_LIBS)
5
6plugin_LTLIBRARIES = icns.la
7icns_la_SOURCES = plugin-icns.cpp
8icns_la_LDFLAGS = -module -export-dynamic $(AM_LDFLAGS)
9
10noinst_HEADERS = plugin-icns.h
110
=== removed file 'src/plugin-icns/plugin-icns.cpp'
--- src/plugin-icns/plugin-icns.cpp 2010-05-11 20:20:59 +0000
+++ src/plugin-icns/plugin-icns.cpp 1970-01-01 00:00:00 +0000
@@ -1,84 +0,0 @@
1#include "plugin-icns.h"
2
3
4GdkPixbuf * iIcons::get_pixbuf ()
5{
6 GdkPixbuf * temp;
7 string final_name;
8
9 temp = load_icns ("512","32");
10 if(temp == NULL)
11 temp = load_icns ("256","32");
12 if(temp == NULL)
13 temp = load_icns ("128","32");
14
15 /*if (temp == NULL)
16 {
17 final_name = "/tmp/_128x128x32.png";
18 g_print("PLUGIN:Filename to load: %s\n", final_name.c_str());
19 temp = gdk_pixbuf_new_from_file(final_name.c_str(),NULL);
20 }*/
21
22
23 if(temp == NULL)
24 {
25 return ui->get_file_icon(m_file_info, 200);
26 }
27 else
28 {
29
30 return temp;
31 }
32
33};
34
35// ==================== LOAD ICNS ======================= //
36GdkPixbuf* iIcons:: load_icns (string size, string depth)
37{
38 GdkPixbuf * temp;
39 string final_name;
40 //FIXME: Take care of the spaces and change them for "\ "
41 string cmd = "icns2png -x -s " + size +" -d "+ depth + " -o /tmp/ " + replace_spaces(m_filename);
42 g_debug("PLUGIN: Loading icon (%s)",m_filename.c_str());
43 g_debug("PLUGIN: %s",cmd.c_str());
44
45 //Launch icns2png
46 g_spawn_command_line_sync (cmd.c_str(), NULL, NULL, NULL, NULL);
47
48 //Get the created file
49 int last_slash = m_filename.rfind("/");
50 int last_dot = m_filename.rfind(".");
51
52 //g_print("PLUGIN SLASH:%i DOT:%i\n",last_slash, last_dot);
53
54 final_name = "/tmp"+ m_filename.substr(last_slash, last_dot - last_slash ) +"_"+size+"x"+size+"x"+depth+".png";
55 g_debug("PLUGIN:Filename to load: %s", final_name.c_str());
56 temp = gdk_pixbuf_new_from_file(final_name.c_str(),NULL);
57 if(temp != NULL)
58 {
59 string cmd = "rm \"" + final_name + "\"";
60 g_spawn_command_line_sync (cmd.c_str(), NULL, NULL, NULL, NULL);
61 }
62
63 return temp;
64}
65
66// ==================== REPLACE SPACES ======================= //
67string iIcons::replace_spaces (string str)
68{
69 int pos = -2;
70 while(str.find(" ",pos+2) != string::npos)
71 {
72 pos = str.find(" ",pos+2);
73 str = str.replace(pos,1,"\\ ");
74 g_debug("PLUGIN STR: %s",str.c_str());
75 }
76 return str;
77
78 /*pos = str.find(" ",0);
79 if(pos != string::npos)
80 {
81 str = str.replace(pos,1,"\\ ");
82 }*/
83 return str;
84}
850
=== removed file 'src/plugin-icns/plugin-icns.h'
--- src/plugin-icns/plugin-icns.h 2010-05-13 18:56:37 +0000
+++ src/plugin-icns/plugin-icns.h 1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
1#ifndef _IICNS_
2#define _IICNS_
3
4#ifndef PLUGIN_LOADER
5
6// Pixbuf can load icns, we do not need this anymore !
7
8//#include "../gloobus-preview-plugin-manager.h"
9#include "../gloobus-preview-interface-image.h"
10
11class iIcons : public iImage
12{
13 public:
14 virtual GdkPixbuf* get_pixbuf ();
15 string replace_spaces (string str);
16 GdkPixbuf* load_icns (string size, string depth);
17};
18
19extern "C" interface * create() {
20 return new iIcons;
21}
22
23extern "C" void destroy(interface * p) {
24 delete (iIcons*)p;
25}
26
27extern "C" int getVersion() {
28 return MANAGER_VERSION;
29}
30
31#endif
32
33#ifdef PLUGIN_LOADER
34/*
35PluginManager::register_plugin("icns");
36
37if(interface::is_program_available("icns2png")) {
38 PluginManager::register_filetype("image/x-icns", 1);
39}
40*/
41#endif
42
43#endif
44

Subscribers

People subscribed via source and target branches