Merge lp:~ballogy/gloobus-preview/gio-open-uri into lp:gloobus-preview

Proposed by Balló György
Status: Merged
Merged at revision: 294
Proposed branch: lp:~ballogy/gloobus-preview/gio-open-uri
Merge into: lp:gloobus-preview
Diff against target: 82 lines (+14/-16)
4 files modified
src/gloobus-preview-singleton.cpp (+1/-2)
src/gloobus-preview-singleton.h (+0/-1)
src/gloobus-preview-window.cpp (+9/-8)
src/plugin-gstreamer-audio/plugin-gstreamer-audio.cpp (+4/-5)
To merge this branch: bzr merge lp:~ballogy/gloobus-preview/gio-open-uri
Reviewer Review Type Date Requested Status
Gloobus Developers Pending
Review via email: mp+245304@code.launchpad.net

Description of the change

Open URIs with GIO

gnome-open is not available in GNOME 3, so use GIO instead.

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 'src/gloobus-preview-singleton.cpp'
2--- src/gloobus-preview-singleton.cpp 2011-10-31 16:06:58 +0000
3+++ src/gloobus-preview-singleton.cpp 2014-12-22 05:45:35 +0000
4@@ -149,8 +149,7 @@
5 void Gloobus::defaultapp( void )
6 {
7 //m_gloobus_interface->launch_default_app();
8- string cmd = "gnome-open \"" + string(m_uri) + "\"" ;
9- g_spawn_command_line_async(cmd.c_str(), NULL);
10+ g_app_info_launch_default_for_uri(m_uri, NULL, NULL);
11 quit();
12 }
13
14
15=== modified file 'src/gloobus-preview-singleton.h'
16--- src/gloobus-preview-singleton.h 2011-10-30 20:42:38 +0000
17+++ src/gloobus-preview-singleton.h 2014-12-22 05:45:35 +0000
18@@ -120,7 +120,6 @@
19 void fullscreen ( void );
20
21 /* launches default application for current file
22- * $ gnome-open <filename>
23 * */
24 void defaultapp ( void );
25
26
27=== modified file 'src/gloobus-preview-window.cpp'
28--- src/gloobus-preview-window.cpp 2012-04-06 10:42:24 +0000
29+++ src/gloobus-preview-window.cpp 2014-12-22 05:45:35 +0000
30@@ -556,16 +556,17 @@
31 void GloobusUI::menu_item_cb( GtkMenuItem * item, gpointer data)
32 {
33 GloobusUI *ui = (GloobusUI*)data;
34- string cmd;
35+ string uri;
36 string label(gtk_menu_item_get_label(item));
37- if(label == _("Settings"))
38- cmd = "gloobus-preview-configuration";
39- else if(label == _("Report a Bug"))
40- cmd = "gnome-open \"https://bugs.launchpad.net/gloobus-preview/\"";
41+ if(label == _("Settings")) {
42+ g_spawn_command_line_async("gloobus-preview-configuration", NULL);
43+ return;
44+ } else if(label == _("Report a Problem"))
45+ uri = "https://bugs.launchpad.net/gloobus-preview/";
46 else if(label == _("Blog"))
47- cmd = "gnome-open \"http://gloobus.wordpress.com\"" ;
48+ uri = "http://gloobus.wordpress.com" ;
49 else if(label == _("Donate"))
50- cmd = "gnome-open \"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=guitarboy000%40gmail%2ecom&item_name=Gloobus%2c%20A%20Quicklook%20for%20linux&no_shipping=0&no_note=1&tax=0&currency_code=EUR&lc=US&bn=PP%2dDonationsBF&chars\"" ;
51+ uri = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=guitarboy000%40gmail%2ecom&item_name=Gloobus%2c%20A%20Quicklook%20for%20linux&no_shipping=0&no_note=1&tax=0&currency_code=EUR&lc=US&bn=PP%2dDonationsBF&chars" ;
52 else if(label == _("About"))
53 ui->create_about();
54 else if(label == _("Quit"))
55@@ -574,7 +575,7 @@
56 g_debug("Uknown menu item label");
57 return;
58 }
59- g_spawn_command_line_async(cmd.c_str(), NULL);
60+ g_app_info_launch_default_for_uri(uri.c_str(), NULL, NULL);
61 }
62
63 gboolean GloobusUI::focus_out_cb( GtkWidget *widget,
64
65=== modified file 'src/plugin-gstreamer-audio/plugin-gstreamer-audio.cpp'
66--- src/plugin-gstreamer-audio/plugin-gstreamer-audio.cpp 2012-04-06 10:42:24 +0000
67+++ src/plugin-gstreamer-audio/plugin-gstreamer-audio.cpp 2014-12-22 05:45:35 +0000
68@@ -337,10 +337,9 @@
69 // ============================ SEARCH LYRICS CB =============================== //
70 void iAudio::search_lyrics_cb(GtkWidget *widget, gpointer data)
71 {
72- //http://search.mp3lyrics.org/?artist=oasis+&song=don%27t+go+away
73+ //http://mp3lyrics.com/Search/Advanced/?Track=don%27t+go+away&Artist=oasis
74 iAudio * audio = (iAudio*)data;
75- string url = "http://search.mp3lyrics.org/?artist=" + audio->get_artist() + "&song="+audio->get_title();
76- string cmd = "gnome-open \"" + url + "\"";
77- g_spawn_command_line_async(cmd.c_str(), NULL);
78- g_debug("Searching Lyrics: %s",url.c_str());
79+ string uri = "http://mp3lyrics.com/Search/Advanced/?Track="+audio->get_title()+"&Artist=" + audio->get_artist();
80+ g_app_info_launch_default_for_uri(uri.c_str(), NULL, NULL);
81+ g_debug("Searching Lyrics: %s",uri.c_str());
82 }

Subscribers

People subscribed via source and target branches