Use #if instead of #ifdef consistently
This commit is contained in:
parent
3caa11b63e
commit
74a587f5e8
5 changed files with 28 additions and 28 deletions
|
@ -25,7 +25,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
#if ENABLE_NLS
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -397,7 +397,7 @@ main (int argc,
|
||||||
gchar* homepage;
|
gchar* homepage;
|
||||||
MidoriWebList* search_engines;
|
MidoriWebList* search_engines;
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
#if ENABLE_NLS
|
||||||
bindtextdomain (GETTEXT_PACKAGE, MIDORI_LOCALEDIR);
|
bindtextdomain (GETTEXT_PACKAGE, MIDORI_LOCALEDIR);
|
||||||
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||||
textdomain (GETTEXT_PACKAGE);
|
textdomain (GETTEXT_PACKAGE);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
|
|
||||||
#ifdef HAVE_UNIQUE
|
#if HAVE_UNIQUE
|
||||||
#include <unique/unique.h>
|
#include <unique/unique.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ midori_app_constructor (GType type,
|
||||||
type, n_construct_properties, construct_properties);
|
type, n_construct_properties, construct_properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_UNIQUE
|
#if HAVE_UNIQUE
|
||||||
static UniqueResponse
|
static UniqueResponse
|
||||||
midori_browser_message_received_cb (UniqueApp* instance,
|
midori_browser_message_received_cb (UniqueApp* instance,
|
||||||
UniqueCommand command,
|
UniqueCommand command,
|
||||||
|
@ -225,7 +225,7 @@ midori_browser_message_received_cb (UniqueApp* instance,
|
||||||
static void
|
static void
|
||||||
midori_app_init (MidoriApp* app)
|
midori_app_init (MidoriApp* app)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_UNIQUE
|
#if HAVE_UNIQUE
|
||||||
gchar* display_name;
|
gchar* display_name;
|
||||||
gchar* instance_name;
|
gchar* instance_name;
|
||||||
guint i, n;
|
guint i, n;
|
||||||
|
@ -241,7 +241,7 @@ midori_app_init (MidoriApp* app)
|
||||||
app->trash = midori_web_list_new ();
|
app->trash = midori_web_list_new ();
|
||||||
app->search_engines = midori_web_list_new ();
|
app->search_engines = midori_web_list_new ();
|
||||||
|
|
||||||
#ifdef HAVE_UNIQUE
|
#if HAVE_UNIQUE
|
||||||
display_name = g_strdup (gdk_display_get_name (gdk_display_get_default ()));
|
display_name = g_strdup (gdk_display_get_name (gdk_display_get_default ()));
|
||||||
n = strlen (display_name);
|
n = strlen (display_name);
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
|
@ -422,7 +422,7 @@ midori_app_instance_is_running (MidoriApp* app)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (MIDORI_IS_APP (app), FALSE);
|
g_return_val_if_fail (MIDORI_IS_APP (app), FALSE);
|
||||||
|
|
||||||
#ifdef HAVE_UNIQUE
|
#if HAVE_UNIQUE
|
||||||
return unique_app_is_running (app->instance);
|
return unique_app_is_running (app->instance);
|
||||||
#else
|
#else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -443,14 +443,14 @@ midori_app_instance_is_running (MidoriApp* app)
|
||||||
gboolean
|
gboolean
|
||||||
midori_app_instance_send_activate (MidoriApp* app)
|
midori_app_instance_send_activate (MidoriApp* app)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_UNIQUE
|
#if HAVE_UNIQUE
|
||||||
UniqueResponse response;
|
UniqueResponse response;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
g_return_val_if_fail (MIDORI_IS_APP (app), FALSE);
|
g_return_val_if_fail (MIDORI_IS_APP (app), FALSE);
|
||||||
g_return_val_if_fail (midori_app_instance_is_running (app), FALSE);
|
g_return_val_if_fail (midori_app_instance_is_running (app), FALSE);
|
||||||
|
|
||||||
#ifdef HAVE_UNIQUE
|
#if HAVE_UNIQUE
|
||||||
response = unique_app_send_message (app->instance, UNIQUE_ACTIVATE, NULL);
|
response = unique_app_send_message (app->instance, UNIQUE_ACTIVATE, NULL);
|
||||||
if (response == UNIQUE_RESPONSE_OK)
|
if (response == UNIQUE_RESPONSE_OK)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -474,7 +474,7 @@ gboolean
|
||||||
midori_app_instance_send_uris (MidoriApp* app,
|
midori_app_instance_send_uris (MidoriApp* app,
|
||||||
gchar** uris)
|
gchar** uris)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_UNIQUE
|
#if HAVE_UNIQUE
|
||||||
UniqueMessageData* message;
|
UniqueMessageData* message;
|
||||||
UniqueResponse response;
|
UniqueResponse response;
|
||||||
#endif
|
#endif
|
||||||
|
@ -483,7 +483,7 @@ midori_app_instance_send_uris (MidoriApp* app,
|
||||||
g_return_val_if_fail (midori_app_instance_is_running (app), FALSE);
|
g_return_val_if_fail (midori_app_instance_is_running (app), FALSE);
|
||||||
g_return_val_if_fail (uris != NULL, FALSE);
|
g_return_val_if_fail (uris != NULL, FALSE);
|
||||||
|
|
||||||
#ifdef HAVE_UNIQUE
|
#if HAVE_UNIQUE
|
||||||
message = unique_message_data_new ();
|
message = unique_message_data_new ();
|
||||||
unique_message_data_set_uris (message, uris);
|
unique_message_data_set_uris (message, uris);
|
||||||
response = unique_app_send_message (app->instance, UNIQUE_OPEN, message);
|
response = unique_app_send_message (app->instance, UNIQUE_OPEN, message);
|
||||||
|
@ -525,7 +525,7 @@ midori_app_add_browser (MidoriApp* app,
|
||||||
|
|
||||||
app->browsers = g_list_prepend (app->browsers, browser);
|
app->browsers = g_list_prepend (app->browsers, browser);
|
||||||
|
|
||||||
#ifdef HAVE_UNIQUE
|
#if HAVE_UNIQUE
|
||||||
if (app->instance)
|
if (app->instance)
|
||||||
unique_app_watch_window (app->instance, GTK_WINDOW (browser));
|
unique_app_watch_window (app->instance, GTK_WINDOW (browser));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "gjs.h"
|
#include "gjs.h"
|
||||||
|
|
||||||
#ifdef HAVE_GIO
|
#if HAVE_GIO
|
||||||
#include <gio/gio.h>
|
#include <gio/gio.h>
|
||||||
#endif
|
#endif
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
|
@ -1829,14 +1829,14 @@ _action_source_view_activate (GtkAction* action,
|
||||||
#if HAVE_GIO
|
#if HAVE_GIO
|
||||||
GFile* file;
|
GFile* file;
|
||||||
gchar* tag;
|
gchar* tag;
|
||||||
#ifdef HAVE_GTKSOURCEVIEW
|
#if HAVE_GTKSOURCEVIEW
|
||||||
GFileInfo* info;
|
GFileInfo* info;
|
||||||
const gchar* content_type;
|
const gchar* content_type;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
gchar* contents;
|
gchar* contents;
|
||||||
gchar* contents_utf8;
|
gchar* contents_utf8;
|
||||||
#ifdef HAVE_GTKSOURCEVIEW
|
#if HAVE_GTKSOURCEVIEW
|
||||||
GtkSourceBuffer* buffer;
|
GtkSourceBuffer* buffer;
|
||||||
#if HAVE_GIO
|
#if HAVE_GIO
|
||||||
GtkSourceLanguageManager* language_manager;
|
GtkSourceLanguageManager* language_manager;
|
||||||
|
@ -1858,12 +1858,12 @@ _action_source_view_activate (GtkAction* action,
|
||||||
#if HAVE_GIO
|
#if HAVE_GIO
|
||||||
file = g_file_new_for_uri (uri);
|
file = g_file_new_for_uri (uri);
|
||||||
tag = NULL;
|
tag = NULL;
|
||||||
#ifdef HAVE_GTKSOURCEVIEW
|
#if HAVE_GTKSOURCEVIEW
|
||||||
content_type = NULL;
|
content_type = NULL;
|
||||||
#endif
|
#endif
|
||||||
if (g_file_load_contents (file, NULL, &contents, NULL, &tag, NULL))
|
if (g_file_load_contents (file, NULL, &contents, NULL, &tag, NULL))
|
||||||
{
|
{
|
||||||
#ifdef HAVE_GTKSOURCEVIEW
|
#if HAVE_GTKSOURCEVIEW
|
||||||
info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
|
info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
|
||||||
G_FILE_QUERY_INFO_NONE, NULL, NULL);
|
G_FILE_QUERY_INFO_NONE, NULL, NULL);
|
||||||
content_type = g_file_info_get_content_type (info);
|
content_type = g_file_info_get_content_type (info);
|
||||||
|
@ -1880,10 +1880,10 @@ _action_source_view_activate (GtkAction* action,
|
||||||
#endif
|
#endif
|
||||||
contents_utf8 = contents;
|
contents_utf8 = contents;
|
||||||
|
|
||||||
#ifdef HAVE_GTKSOURCEVIEW
|
#if HAVE_GTKSOURCEVIEW
|
||||||
buffer = gtk_source_buffer_new (NULL);
|
buffer = gtk_source_buffer_new (NULL);
|
||||||
gtk_source_buffer_set_highlight_syntax (buffer, TRUE);
|
gtk_source_buffer_set_highlight_syntax (buffer, TRUE);
|
||||||
#ifdef HAVE_GIO
|
#if HAVE_GIO
|
||||||
if (content_type)
|
if (content_type)
|
||||||
{
|
{
|
||||||
language_manager = gtk_source_language_manager_get_default ();
|
language_manager = gtk_source_language_manager_get_default ();
|
||||||
|
@ -1912,7 +1912,7 @@ _action_source_view_activate (GtkAction* action,
|
||||||
#endif
|
#endif
|
||||||
if (contents_utf8)
|
if (contents_utf8)
|
||||||
gtk_text_buffer_set_text (GTK_TEXT_BUFFER (buffer), contents_utf8, -1);
|
gtk_text_buffer_set_text (GTK_TEXT_BUFFER (buffer), contents_utf8, -1);
|
||||||
#ifdef HAVE_GTKSOURCEVIEW
|
#if HAVE_GTKSOURCEVIEW
|
||||||
text_view = gtk_source_view_new_with_buffer (buffer);
|
text_view = gtk_source_view_new_with_buffer (buffer);
|
||||||
gtk_source_view_set_show_line_numbers (GTK_SOURCE_VIEW (text_view), TRUE);
|
gtk_source_view_set_show_line_numbers (GTK_SOURCE_VIEW (text_view), TRUE);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include "sokoke.h"
|
#include "sokoke.h"
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
|
|
||||||
#ifdef HAVE_GIO
|
#if HAVE_GIO
|
||||||
#include <gio/gio.h>
|
#include <gio/gio.h>
|
||||||
#endif
|
#endif
|
||||||
#include <webkit/webkit.h>
|
#include <webkit/webkit.h>
|
||||||
|
@ -294,7 +294,7 @@ webkit_web_view_window_object_cleared_cb (MidoriWebView* web_view,
|
||||||
web_view->window_object_cleared = TRUE;
|
web_view->window_object_cleared = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_GIO
|
#if HAVE_GIO
|
||||||
void
|
void
|
||||||
loadable_icon_finish_cb (GdkPixbuf* icon,
|
loadable_icon_finish_cb (GdkPixbuf* icon,
|
||||||
GAsyncResult* res,
|
GAsyncResult* res,
|
||||||
|
@ -380,7 +380,7 @@ file_info_finish_cb (GFile* icon_file,
|
||||||
static void
|
static void
|
||||||
_midori_web_view_load_icon (MidoriWebView* web_view)
|
_midori_web_view_load_icon (MidoriWebView* web_view)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_GIO
|
#if HAVE_GIO
|
||||||
GFile* file;
|
GFile* file;
|
||||||
GFile* icon_file;
|
GFile* icon_file;
|
||||||
#endif
|
#endif
|
||||||
|
@ -388,7 +388,7 @@ _midori_web_view_load_icon (MidoriWebView* web_view)
|
||||||
gint icon_width, icon_height;
|
gint icon_width, icon_height;
|
||||||
GdkPixbuf* pixbuf_scaled;
|
GdkPixbuf* pixbuf_scaled;
|
||||||
|
|
||||||
#ifdef HAVE_GIO
|
#if HAVE_GIO
|
||||||
if (web_view->uri)
|
if (web_view->uri)
|
||||||
{
|
{
|
||||||
file = g_file_new_for_uri (web_view->uri);
|
file = g_file_new_for_uri (web_view->uri);
|
||||||
|
@ -473,7 +473,7 @@ gjs_value_links_foreach_cb (GjsValue* link,
|
||||||
{
|
{
|
||||||
const gchar* type;
|
const gchar* type;
|
||||||
const gchar* rel;
|
const gchar* rel;
|
||||||
#ifdef HAVE_GIO
|
#if HAVE_GIO
|
||||||
GFile* icon_file;
|
GFile* icon_file;
|
||||||
GIcon* icon;
|
GIcon* icon;
|
||||||
#endif
|
#endif
|
||||||
|
@ -494,7 +494,7 @@ gjs_value_links_foreach_cb (GjsValue* link,
|
||||||
? gjs_value_get_attribute_string (link, "title") : NULL);
|
? gjs_value_get_attribute_string (link, "title") : NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef HAVE_GIO
|
#if HAVE_GIO
|
||||||
if (gjs_value_has_attribute (link, "rel"))
|
if (gjs_value_has_attribute (link, "rel"))
|
||||||
{
|
{
|
||||||
rel = gjs_value_get_attribute_string (link, "rel");
|
rel = gjs_value_get_attribute_string (link, "rel");
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include "sokoke.h"
|
#include "sokoke.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#if HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -338,7 +338,7 @@ sokoke_superuser_warning_new (void)
|
||||||
{
|
{
|
||||||
/* Create a horizontal bar with a security warning
|
/* Create a horizontal bar with a security warning
|
||||||
This returns NULL if the user is no superuser */
|
This returns NULL if the user is no superuser */
|
||||||
#ifdef HAVE_UNISTD_H
|
#if HAVE_UNISTD_H
|
||||||
if (G_UNLIKELY (!geteuid ())) /* effective superuser? */
|
if (G_UNLIKELY (!geteuid ())) /* effective superuser? */
|
||||||
{
|
{
|
||||||
GtkWidget* hbox = gtk_event_box_new ();
|
GtkWidget* hbox = gtk_event_box_new ();
|
||||||
|
|
Loading…
Reference in a new issue