update drobilla's fascistic dir-locals.el to force emacs users into whitespace submis...
[ardour.git] / gtk2_ardour / nag.cc
index 7ae1b6e809ec10b350abca1c844f6aafc58abab0..d82d986837bb76b1747cddc6ceacdd876a736f5c 100644 (file)
@@ -5,6 +5,8 @@
 #include <fstream>
 #include <gtkmm/stock.h>
 
+#include "pbd/openuri.h"
+
 #include "ardour/ardour.h"
 #include "ardour/filesystem_paths.h"
 
@@ -89,7 +91,7 @@ NagScreen::nag ()
 NagScreen*
 NagScreen::maybe_nag (std::string why)
 {
-       Glib::ustring path;
+       std::string path;
        bool really_subscribed;
        bool maybe_subscribed;
 
@@ -111,7 +113,7 @@ NagScreen::maybe_nag (std::string why)
 void
 NagScreen::mark_never_again ()
 {
-       Glib::ustring path;
+       std::string path;
 
        path = Glib::build_filename (user_config_directory().to_string(), ".nevernag");
 
@@ -121,7 +123,7 @@ NagScreen::mark_never_again ()
 void
 NagScreen::mark_subscriber ()
 {
-       Glib::ustring path;
+       std::string path;
 
        path = Glib::build_filename (user_config_directory().to_string(), ".askedaboutsub");
 
@@ -131,7 +133,7 @@ NagScreen::mark_subscriber ()
 void
 NagScreen::mark_affirmed_subscriber ()
 {
-       Glib::ustring path;
+       std::string path;
 
        path = Glib::build_filename (user_config_directory().to_string(), ".isubscribe");
 
@@ -141,7 +143,7 @@ NagScreen::mark_affirmed_subscriber ()
 bool
 NagScreen::is_subscribed (bool& really)
 {
-       Glib::ustring path;
+       std::string path;
 
        really = false;
 
@@ -176,35 +178,16 @@ NagScreen::offer_to_donate ()
 
        /* we don't care if it fails */
 
-       open_uri (uri);
+        PBD::open_uri (uri);
 }
 
 void
 NagScreen::offer_to_subscribe ()
 {
        const char* uri = "http://ardour.org/subscribe";
-
-       if (open_uri (uri)) {
+        
+       if (PBD::open_uri (uri)) {
                mark_subscriber ();
        }
 }
 
-bool
-NagScreen::open_uri (const char* uri)
-{
-#ifdef HAVE_GTK_OPEN_URI
-       GError* err;
-       return gtk_open_uri (0, uri, GDK_CURRENT_TIME, &err);
-#else
-#ifdef GTKOSX
-       extern bool cocoa_open_url (const char*);
-       return cocoa_open_url (uri);
-#else
-       std::string command = "xdg-open ";
-       command += uri;
-       spawn_command_line_async (command);
-
-       return true;
-#endif
-#endif
-}