diff --git a/moo.kdevelop b/moo.kdevelop index b785f992..c332bd7c 100644 --- a/moo.kdevelop +++ b/moo.kdevelop @@ -46,7 +46,7 @@ - --enable-debug=full --enable-all-gcc-warnings=fatal --enable-developer-mode --disable-moo-module --without-mooui --without-mooapp --without-mooterm --without-mooedit --without-python + --enable-debug=full --enable-all-gcc-warnings=fatal --enable-developer-mode --disable-moo-module --without-mooui --without-mooapp --without-mooterm --without-python build/debug kdevgccoptions kdevgppoptions diff --git a/moo/mooedit/Makefile.am b/moo/mooedit/Makefile.am index 4b3b59af..1aeb15ff 100644 --- a/moo/mooedit/Makefile.am +++ b/moo/mooedit/Makefile.am @@ -54,6 +54,9 @@ libmooedit_la_SOURCES = \ mooeditsearch.c \ mooeditsearch.h \ mooeditwindow.c \ + moofileview.c \ + moofileview.h \ + moofileview-icons.c \ mootextiter.h if USE_XML diff --git a/moo/mooutils/moofileview-icons.c b/moo/mooedit/moofileview-icons.c similarity index 99% rename from moo/mooutils/moofileview-icons.c rename to moo/mooedit/moofileview-icons.c index 20b033cb..bc6406f0 100644 --- a/moo/mooutils/moofileview-icons.c +++ b/moo/mooedit/moofileview-icons.c @@ -11,7 +11,7 @@ * See COPYING file that comes with this distribution. */ -#include "mooutils/moofileview.h" +#include "mooedit/moofileview.h" #include #include #include diff --git a/moo/mooutils/moofileview.c b/moo/mooedit/moofileview.c similarity index 99% rename from moo/mooutils/moofileview.c rename to moo/mooedit/moofileview.c index 19440b71..0b633345 100644 --- a/moo/mooutils/moofileview.c +++ b/moo/mooedit/moofileview.c @@ -1,5 +1,5 @@ /* - * mooutils/moofileview.c + * mooedit/moofileview.c * * Copyright (C) 2004-2005 by Yevgen Muntyan * @@ -11,7 +11,11 @@ * See COPYING file that comes with this distribution. */ -#include "mooutils/moofileview.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "mooedit/moofileview.h" #include "mooutils/moomarshals.h" #include #include @@ -19,6 +23,9 @@ #include #include +#ifdef USE_XDGMIME +#include "mooedit/xdgmime/xdgmime.h" +#endif #define TREEVIEW_UPDATE_TIMEOUT 0.5 @@ -35,7 +42,7 @@ struct _MooFileViewFile { char *fullname; char *uri; char *display_name; - char *mime_type; + const char *mime_type; GdkPixbuf *pixbuf; gboolean is_dir; struct stat statbuf; @@ -769,14 +776,20 @@ static MooFileViewFile *file_new (MooFileView *fileview, g_return_val_if_fail (basename != NULL, NULL); g_return_val_if_fail (fullname != NULL, NULL); - file = g_new (MooFileViewFile, 1); + file = g_new0 (MooFileViewFile, 1); file->ref_count = 1; file->basename = g_strdup (basename); file->fullname = g_strdup (fullname); file->uri = g_strdup_printf ("file://%s", fullname); file->display_name = g_filename_display_basename (basename); + +#ifdef USE_XDGMIME + file->mime_type = xdg_mime_get_mime_type_for_file (fullname); +#else file->mime_type = NULL; +#endif + file->time = NULL; /* struct tm* */ file->date_string = NULL; @@ -836,7 +849,6 @@ static void file_unref (MooFileViewFile *file) g_free (file->fullname); g_free (file->uri); g_free (file->display_name); - g_free (file->mime_type); if (file->pixbuf) g_object_unref (file->pixbuf); g_free (file->time); /* struct tm* */ g_free (file->date_string); diff --git a/moo/mooutils/moofileview.h b/moo/mooedit/moofileview.h similarity index 100% rename from moo/mooutils/moofileview.h rename to moo/mooedit/moofileview.h diff --git a/moo/mooutils/Makefile.am b/moo/mooutils/Makefile.am index 3ab3252c..966c0411 100644 --- a/moo/mooutils/Makefile.am +++ b/moo/mooutils/Makefile.am @@ -48,9 +48,6 @@ libmooutils_la_SOURCES = \ moodialogs.h \ moofileutils.c \ moofileutils.h \ - moofileview.c \ - moofileview.h \ - moofileview-icons.c \ moolog.c \ moolog.h \ moomarkup.c \ diff --git a/tests/Makefile.am b/tests/Makefile.am index 9c3c01a3..7457042f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,7 +2,7 @@ # tests/Makefile.am # -EXTRA_PROGRAMS = medit mterm markup editor termbuffer +EXTRA_PROGRAMS = medit mterm markup editor termbuffer testfileview testpaned bin_PROGRAMS = noinst_PROGRAMS = @@ -21,13 +21,13 @@ if BUILD_MOOAPP bin_PROGRAMS += editor endif if BUILD_MOOEDIT -noinst_PROGRAMS += medit +noinst_PROGRAMS += medit testfileview endif if BUILD_MOOTERM noinst_PROGRAMS += mterm termbuffer endif if BUILD_MOOUTILS -noinst_PROGRAMS += markup testpaned testfileview +noinst_PROGRAMS += markup testpaned endif