Use #if instead of #ifdef consistently

This commit is contained in:
Christian Dywan 2008-08-23 23:44:55 +02:00
parent 3caa11b63e
commit 74a587f5e8
5 changed files with 28 additions and 28 deletions

View file

@ -25,7 +25,7 @@
#include <string.h>
#include <gtk/gtk.h>
#ifdef ENABLE_NLS
#if ENABLE_NLS
#include <libintl.h>
#endif
@ -397,7 +397,7 @@ main (int argc,
gchar* homepage;
MidoriWebList* search_engines;
#ifdef ENABLE_NLS
#if ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, MIDORI_LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);

View file

@ -19,7 +19,7 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#ifdef HAVE_UNIQUE
#if HAVE_UNIQUE
#include <unique/unique.h>
#endif
@ -174,7 +174,7 @@ midori_app_constructor (GType type,
type, n_construct_properties, construct_properties);
}
#ifdef HAVE_UNIQUE
#if HAVE_UNIQUE
static UniqueResponse
midori_browser_message_received_cb (UniqueApp* instance,
UniqueCommand command,
@ -225,7 +225,7 @@ midori_browser_message_received_cb (UniqueApp* instance,
static void
midori_app_init (MidoriApp* app)
{
#ifdef HAVE_UNIQUE
#if HAVE_UNIQUE
gchar* display_name;
gchar* instance_name;
guint i, n;
@ -241,7 +241,7 @@ midori_app_init (MidoriApp* app)
app->trash = 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 ()));
n = strlen (display_name);
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);
#ifdef HAVE_UNIQUE
#if HAVE_UNIQUE
return unique_app_is_running (app->instance);
#else
return FALSE;
@ -443,14 +443,14 @@ midori_app_instance_is_running (MidoriApp* app)
gboolean
midori_app_instance_send_activate (MidoriApp* app)
{
#ifdef HAVE_UNIQUE
#if HAVE_UNIQUE
UniqueResponse response;
#endif
g_return_val_if_fail (MIDORI_IS_APP (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);
if (response == UNIQUE_RESPONSE_OK)
return TRUE;
@ -474,7 +474,7 @@ gboolean
midori_app_instance_send_uris (MidoriApp* app,
gchar** uris)
{
#ifdef HAVE_UNIQUE
#if HAVE_UNIQUE
UniqueMessageData* message;
UniqueResponse response;
#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 (uris != NULL, FALSE);
#ifdef HAVE_UNIQUE
#if HAVE_UNIQUE
message = unique_message_data_new ();
unique_message_data_set_uris (message, uris);
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);
#ifdef HAVE_UNIQUE
#if HAVE_UNIQUE
if (app->instance)
unique_app_watch_window (app->instance, GTK_WINDOW (browser));
#endif

View file

@ -28,7 +28,7 @@
#include "compat.h"
#include "gjs.h"
#ifdef HAVE_GIO
#if HAVE_GIO
#include <gio/gio.h>
#endif
#include <glib/gi18n.h>
@ -1829,14 +1829,14 @@ _action_source_view_activate (GtkAction* action,
#if HAVE_GIO
GFile* file;
gchar* tag;
#ifdef HAVE_GTKSOURCEVIEW
#if HAVE_GTKSOURCEVIEW
GFileInfo* info;
const gchar* content_type;
#endif
#endif
gchar* contents;
gchar* contents_utf8;
#ifdef HAVE_GTKSOURCEVIEW
#if HAVE_GTKSOURCEVIEW
GtkSourceBuffer* buffer;
#if HAVE_GIO
GtkSourceLanguageManager* language_manager;
@ -1858,12 +1858,12 @@ _action_source_view_activate (GtkAction* action,
#if HAVE_GIO
file = g_file_new_for_uri (uri);
tag = NULL;
#ifdef HAVE_GTKSOURCEVIEW
#if HAVE_GTKSOURCEVIEW
content_type = NULL;
#endif
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,
G_FILE_QUERY_INFO_NONE, NULL, NULL);
content_type = g_file_info_get_content_type (info);
@ -1880,10 +1880,10 @@ _action_source_view_activate (GtkAction* action,
#endif
contents_utf8 = contents;
#ifdef HAVE_GTKSOURCEVIEW
#if HAVE_GTKSOURCEVIEW
buffer = gtk_source_buffer_new (NULL);
gtk_source_buffer_set_highlight_syntax (buffer, TRUE);
#ifdef HAVE_GIO
#if HAVE_GIO
if (content_type)
{
language_manager = gtk_source_language_manager_get_default ();
@ -1912,7 +1912,7 @@ _action_source_view_activate (GtkAction* action,
#endif
if (contents_utf8)
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);
gtk_source_view_set_show_line_numbers (GTK_SOURCE_VIEW (text_view), TRUE);
#else

View file

@ -20,7 +20,7 @@
#include "sokoke.h"
#include "compat.h"
#ifdef HAVE_GIO
#if HAVE_GIO
#include <gio/gio.h>
#endif
#include <webkit/webkit.h>
@ -294,7 +294,7 @@ webkit_web_view_window_object_cleared_cb (MidoriWebView* web_view,
web_view->window_object_cleared = TRUE;
}
#ifdef HAVE_GIO
#if HAVE_GIO
void
loadable_icon_finish_cb (GdkPixbuf* icon,
GAsyncResult* res,
@ -380,7 +380,7 @@ file_info_finish_cb (GFile* icon_file,
static void
_midori_web_view_load_icon (MidoriWebView* web_view)
{
#ifdef HAVE_GIO
#if HAVE_GIO
GFile* file;
GFile* icon_file;
#endif
@ -388,7 +388,7 @@ _midori_web_view_load_icon (MidoriWebView* web_view)
gint icon_width, icon_height;
GdkPixbuf* pixbuf_scaled;
#ifdef HAVE_GIO
#if HAVE_GIO
if (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* rel;
#ifdef HAVE_GIO
#if HAVE_GIO
GFile* icon_file;
GIcon* icon;
#endif
@ -494,7 +494,7 @@ gjs_value_links_foreach_cb (GjsValue* link,
? gjs_value_get_attribute_string (link, "title") : NULL);
}
}
#ifdef HAVE_GIO
#if HAVE_GIO
if (gjs_value_has_attribute (link, "rel"))
{
rel = gjs_value_get_attribute_string (link, "rel");

View file

@ -16,7 +16,7 @@
#include "sokoke.h"
#include "main.h"
#ifdef HAVE_UNISTD_H
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
@ -338,7 +338,7 @@ sokoke_superuser_warning_new (void)
{
/* Create a horizontal bar with a security warning
This returns NULL if the user is no superuser */
#ifdef HAVE_UNISTD_H
#if HAVE_UNISTD_H
if (G_UNLIKELY (!geteuid ())) /* effective superuser? */
{
GtkWidget* hbox = gtk_event_box_new ();