SF.net SVN: geany:[2991] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Wed Sep 24 12:07:23 UTC 2008
Revision: 2991
http://geany.svn.sourceforge.net/geany/?rev=2991&view=rev
Author: ntrel
Date: 2008-09-24 12:07:22 +0000 (Wed, 24 Sep 2008)
Log Message:
-----------
Show SVN revision also for geany -v and first status message.
Add main_get_version_string().
Rename get_argv_filename() main_get_argv_filename().
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/about.c
trunk/src/main.c
trunk/src/main.h
trunk/src/socket.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-09-24 12:01:21 UTC (rev 2990)
+++ trunk/ChangeLog 2008-09-24 12:07:22 UTC (rev 2991)
@@ -1,3 +1,11 @@
+2008-09-24 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/main.h, src/about.c, src/main.c, src/socket.c:
+ Show SVN revision also for geany -v and first status message.
+ Add main_get_version_string().
+ Rename get_argv_filename() main_get_argv_filename().
+
+
2008-09-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* HACKING:
Modified: trunk/src/about.c
===================================================================
--- trunk/src/about.c 2008-09-24 12:01:21 UTC (rev 2990)
+++ trunk/src/about.c 2008-09-24 12:07:22 UTC (rev 2991)
@@ -31,12 +31,13 @@
#include "ui_utils.h"
#include "support.h"
#include "geanywraplabel.h"
+#include "main.h"
static GtkWidget *gb_window = NULL;
#include "gb.c"
-#define HEADER "<span size=\"larger\" weight=\"bold\">Geany " VERSION "%s</span>"
+#define HEADER "<span size=\"larger\" weight=\"bold\">Geany %s</span>"
#define INFO "<span size=\"larger\" weight=\"bold\">%s</span>"
#define CODENAME "<span weight=\"bold\">\"" GEANY_CODENAME "\"</span>"
#define BUILDDATE "<span size=\"smaller\">%s</span>"
@@ -149,8 +150,7 @@
header_label = gtk_label_new(NULL);
gtk_label_set_use_markup(GTK_LABEL(header_label), TRUE);
/* print the subversion revision generated by ./configure if it is available */
- g_snprintf(buffer, sizeof(buffer), HEADER,
- (utils_str_equal(REVISION, "-1")) ? "" : "svn >= " REVISION);
+ g_snprintf(buffer, sizeof(buffer), HEADER, main_get_version_string());
gtk_label_set_markup(GTK_LABEL(header_label), buffer);
gtk_widget_show(header_label);
gtk_box_pack_start(GTK_BOX(header_hbox), header_label, FALSE,FALSE,0);
Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c 2008-09-24 12:01:21 UTC (rev 2990)
+++ trunk/src/main.c 2008-09-24 12:07:22 UTC (rev 2991)
@@ -302,9 +302,20 @@
}
+const gchar *main_get_version_string(void)
+{
+ static gchar full[] = VERSION " (svn >= " REVISION ")";
+
+ if (utils_str_equal(REVISION, "-1"))
+ return VERSION;
+ else
+ return full;
+}
+
+
/* get the full file path of a command-line argument
* N.B. the result should be freed and may contain '/../' or '/./ ' */
-gchar *get_argv_filename(const gchar *filename)
+gchar *main_get_argv_filename(const gchar *filename)
{
gchar *result;
@@ -483,7 +494,7 @@
if (show_version)
{
- printf(PACKAGE " " VERSION " ");
+ printf(PACKAGE " %s ", main_get_version_string());
printf(_("(built on %s with GTK %d.%d.%d, GLib %d.%d.%d)"),
__DATE__, GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION,
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
@@ -654,7 +665,7 @@
for (i = 1; i < argc; i++)
{
- gchar *filename = get_argv_filename(argv[i]);
+ gchar *filename = main_get_argv_filename(argv[i]);
if (filename && !main_handle_filename(filename))
{
@@ -759,9 +770,8 @@
}
#endif
- geany_debug("Geany %s%s, GTK+ %u.%u.%u, GLib %u.%u.%u",
- VERSION,
- (utils_str_equal(REVISION, "-1")) ? "" : " svn >= " REVISION,
+ geany_debug("Geany %s, GTK+ %u.%u.%u, GLib %u.%u.%u",
+ main_get_version_string(),
gtk_major_version, gtk_minor_version, gtk_micro_version,
glib_major_version, glib_minor_version, glib_micro_version);
@@ -816,7 +826,7 @@
#endif
ui_create_recent_menu();
- ui_set_statusbar(TRUE, _("This is Geany %s."), VERSION);
+ ui_set_statusbar(TRUE, _("This is Geany %s."), main_get_version_string());
if (config_dir_result != 0)
ui_set_statusbar(TRUE, _("Configuration directory could not be created (%s)."),
g_strerror(config_dir_result));
Modified: trunk/src/main.h
===================================================================
--- trunk/src/main.h 2008-09-24 12:01:21 UTC (rev 2990)
+++ trunk/src/main.h 2008-09-24 12:07:22 UTC (rev 2991)
@@ -49,8 +49,10 @@
extern GeanyStatus main_status;
-gchar *get_argv_filename(const gchar *filename);
+const gchar *main_get_version_string(void);
+gchar *main_get_argv_filename(const gchar *filename);
+
void main_quit(void);
gboolean main_handle_filename(gchar *locale_filename);
Modified: trunk/src/socket.c
===================================================================
--- trunk/src/socket.c 2008-09-24 12:01:21 UTC (rev 2990)
+++ trunk/src/socket.c 2008-09-24 12:07:22 UTC (rev 2991)
@@ -144,7 +144,7 @@
for (i = 1; i < argc && argv[i] != NULL; i++)
{
- filename = get_argv_filename(argv[i]);
+ filename = main_get_argv_filename(argv[i]);
/* if the filename is valid or if a new file should be opened is check on the other side */
if (filename != NULL)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list