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
1=== modified file 'configure.ac'
2--- configure.ac 2014-12-25 16:27:26 +0000
3+++ configure.ac 2014-12-26 04:39:04 +0000
4@@ -81,7 +81,6 @@
5 src/plugin-folder/Makefile
6 src/plugin-compressed/Makefile
7 src/plugin-djvu/Makefile
8- src/plugin-icns/Makefile
9 src/plugin-gstreamer-audio/Makefile
10 src/plugin-gstreamer-video/Makefile
11 src/plugin-pdf/Makefile
12
13=== modified file 'src/Makefile.am'
14--- src/Makefile.am 2014-12-25 16:27:26 +0000
15+++ src/Makefile.am 2014-12-26 04:39:04 +0000
16@@ -6,7 +6,6 @@
17 plugin-folder \
18 plugin-compressed \
19 plugin-djvu \
20- plugin-icns \
21 plugin-gstreamer-audio \
22 plugin-gstreamer-video \
23 plugin-pdf \
24
25=== modified file 'src/gloobus-preview-plugin-manager.cpp'
26--- src/gloobus-preview-plugin-manager.cpp 2014-12-25 16:21:13 +0000
27+++ src/gloobus-preview-plugin-manager.cpp 2014-12-26 04:39:04 +0000
28@@ -100,7 +100,6 @@
29 #include "plugin-folder/plugin-folder.h"
30 #include "plugin-gstreamer-audio/plugin-gstreamer-audio.h"
31 #include "plugin-gstreamer-video/plugin-gstreamer-video.h"
32-#include "plugin-icns/plugin-icns.h"
33 #include "plugin-pdf/office-plugin.h"
34 #include "plugin-pdf/pdf-plugin.h"
35 #include "plugin-pixbuf/plugin-pixbuf.h"
36
37=== removed directory 'src/plugin-icns'
38=== removed file 'src/plugin-icns/Makefile.am'
39--- src/plugin-icns/Makefile.am 2010-01-24 20:25:39 +0000
40+++ src/plugin-icns/Makefile.am 1970-01-01 00:00:00 +0000
41@@ -1,10 +0,0 @@
42-plugindir = $(prefix)/lib/gloobus/
43-
44-AM_CPPFLAGS += $(GTK_CFLAGS)
45-AM_LDFLAGS = $(GTK_LIBS)
46-
47-plugin_LTLIBRARIES = icns.la
48-icns_la_SOURCES = plugin-icns.cpp
49-icns_la_LDFLAGS = -module -export-dynamic $(AM_LDFLAGS)
50-
51-noinst_HEADERS = plugin-icns.h
52
53=== removed file 'src/plugin-icns/plugin-icns.cpp'
54--- src/plugin-icns/plugin-icns.cpp 2010-05-11 20:20:59 +0000
55+++ src/plugin-icns/plugin-icns.cpp 1970-01-01 00:00:00 +0000
56@@ -1,84 +0,0 @@
57-#include "plugin-icns.h"
58-
59-
60-GdkPixbuf * iIcons::get_pixbuf ()
61-{
62- GdkPixbuf * temp;
63- string final_name;
64-
65- temp = load_icns ("512","32");
66- if(temp == NULL)
67- temp = load_icns ("256","32");
68- if(temp == NULL)
69- temp = load_icns ("128","32");
70-
71- /*if (temp == NULL)
72- {
73- final_name = "/tmp/_128x128x32.png";
74- g_print("PLUGIN:Filename to load: %s\n", final_name.c_str());
75- temp = gdk_pixbuf_new_from_file(final_name.c_str(),NULL);
76- }*/
77-
78-
79- if(temp == NULL)
80- {
81- return ui->get_file_icon(m_file_info, 200);
82- }
83- else
84- {
85-
86- return temp;
87- }
88-
89-};
90-
91-// ==================== LOAD ICNS ======================= //
92-GdkPixbuf* iIcons:: load_icns (string size, string depth)
93-{
94- GdkPixbuf * temp;
95- string final_name;
96- //FIXME: Take care of the spaces and change them for "\ "
97- string cmd = "icns2png -x -s " + size +" -d "+ depth + " -o /tmp/ " + replace_spaces(m_filename);
98- g_debug("PLUGIN: Loading icon (%s)",m_filename.c_str());
99- g_debug("PLUGIN: %s",cmd.c_str());
100-
101- //Launch icns2png
102- g_spawn_command_line_sync (cmd.c_str(), NULL, NULL, NULL, NULL);
103-
104- //Get the created file
105- int last_slash = m_filename.rfind("/");
106- int last_dot = m_filename.rfind(".");
107-
108- //g_print("PLUGIN SLASH:%i DOT:%i\n",last_slash, last_dot);
109-
110- final_name = "/tmp"+ m_filename.substr(last_slash, last_dot - last_slash ) +"_"+size+"x"+size+"x"+depth+".png";
111- g_debug("PLUGIN:Filename to load: %s", final_name.c_str());
112- temp = gdk_pixbuf_new_from_file(final_name.c_str(),NULL);
113- if(temp != NULL)
114- {
115- string cmd = "rm \"" + final_name + "\"";
116- g_spawn_command_line_sync (cmd.c_str(), NULL, NULL, NULL, NULL);
117- }
118-
119- return temp;
120-}
121-
122-// ==================== REPLACE SPACES ======================= //
123-string iIcons::replace_spaces (string str)
124-{
125- int pos = -2;
126- while(str.find(" ",pos+2) != string::npos)
127- {
128- pos = str.find(" ",pos+2);
129- str = str.replace(pos,1,"\\ ");
130- g_debug("PLUGIN STR: %s",str.c_str());
131- }
132- return str;
133-
134- /*pos = str.find(" ",0);
135- if(pos != string::npos)
136- {
137- str = str.replace(pos,1,"\\ ");
138- }*/
139- return str;
140-}
141
142=== removed file 'src/plugin-icns/plugin-icns.h'
143--- src/plugin-icns/plugin-icns.h 2010-05-13 18:56:37 +0000
144+++ src/plugin-icns/plugin-icns.h 1970-01-01 00:00:00 +0000
145@@ -1,44 +0,0 @@
146-#ifndef _IICNS_
147-#define _IICNS_
148-
149-#ifndef PLUGIN_LOADER
150-
151-// Pixbuf can load icns, we do not need this anymore !
152-
153-//#include "../gloobus-preview-plugin-manager.h"
154-#include "../gloobus-preview-interface-image.h"
155-
156-class iIcons : public iImage
157-{
158- public:
159- virtual GdkPixbuf* get_pixbuf ();
160- string replace_spaces (string str);
161- GdkPixbuf* load_icns (string size, string depth);
162-};
163-
164-extern "C" interface * create() {
165- return new iIcons;
166-}
167-
168-extern "C" void destroy(interface * p) {
169- delete (iIcons*)p;
170-}
171-
172-extern "C" int getVersion() {
173- return MANAGER_VERSION;
174-}
175-
176-#endif
177-
178-#ifdef PLUGIN_LOADER
179-/*
180-PluginManager::register_plugin("icns");
181-
182-if(interface::is_program_available("icns2png")) {
183- PluginManager::register_filetype("image/x-icns", 1);
184-}
185-*/
186-#endif
187-
188-#endif
189-

Subscribers

People subscribed via source and target branches