Revision: 2649
http://geany.svn.sourceforge.net/geany/?rev=2649&view=rev
Author: eht16
Date: 2008-06-05 09:52:39 -0700 (Thu, 05 Jun 2008)
Log Message:
-----------
Remove check for unistd.h, assume it is available (already often used without checking).
Modified Paths:
--------------
trunk/ChangeLog
trunk/configure.in
trunk/tagmanager/entry.c
trunk/wscript
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-06-05 16:42:28 UTC (rev 2648)
+++ trunk/ChangeLog 2008-06-05 16:52:39 UTC (rev 2649)
@@ -3,6 +3,9 @@
* Makefile.am, waf, wscript, scripts/wafinit.sh:
Add alternative build system: Waf.
Use wafinit.sh to create a Makefile and configure files.
+ * configure.in, wscript, tagmanager/entry.c:
+ Remove check for unistd.h, assume it is available (already often
+ used without checking).
2008-06-05 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2008-06-05 16:42:28 UTC (rev 2648)
+++ trunk/configure.in 2008-06-05 16:52:39 UTC (rev 2649)
@@ -33,7 +33,7 @@
# autoscan start
# Checks for header files.
-AC_CHECK_HEADERS([fcntl.h fnmatch.h glob.h regex.h stdlib.h sys/time.h unistd.h])
+AC_CHECK_HEADERS([fcntl.h fnmatch.h glob.h regex.h stdlib.h sys/time.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
Modified: trunk/tagmanager/entry.c
===================================================================
--- trunk/tagmanager/entry.c 2008-06-05 16:42:28 UTC (rev 2648)
+++ trunk/tagmanager/entry.c 2008-06-05 16:52:39 UTC (rev 2649)
@@ -25,10 +25,8 @@
#if defined (HAVE_TYPES_H)
# include <types.h> /* to declare off_t on some hosts */
#endif
-#if defined (HAVE_UNISTD_H)
-# include <unistd.h> /* to declare close (), ftruncate (), truncate () */
-#endif
+
/* These header files provide for the functions necessary to do file
* truncation.
*/
Modified: trunk/wscript
===================================================================
--- trunk/wscript 2008-06-05 16:42:28 UTC (rev 2648)
+++ trunk/wscript 2008-06-05 16:52:39 UTC (rev 2649)
@@ -109,8 +109,7 @@
conf_check_header('sys/time.h')
conf_check_header('sys/types.h')
conf_check_header('sys/stat.h')
- conf_check_header('unistd.h')
- conf.define('HAVE_STDLIB', 1) # are there systems without stdlib.h?
+ conf.define('HAVE_STDLIB_H', 1) # are there systems without stdlib.h?
conf.define('STDC_HEADERS', 1) # an optimistic guess ;-)
if Params.g_options.gnu_regex:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2648
http://geany.svn.sourceforge.net/geany/?rev=2648&view=rev
Author: ntrel
Date: 2008-06-05 09:42:28 -0700 (Thu, 05 Jun 2008)
Log Message:
-----------
Fix segfault after Save As (oops).
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/dialogs.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-06-05 16:07:39 UTC (rev 2647)
+++ trunk/ChangeLog 2008-06-05 16:42:28 UTC (rev 2648)
@@ -16,6 +16,8 @@
* src/document.c:
Only reorder recent files on closing documents that have existed on
disk.
+ * src/dialogs.c:
+ Fix segfault after Save As (oops).
2008-06-04 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/dialogs.c
===================================================================
--- trunk/src/dialogs.c 2008-06-05 16:07:39 UTC (rev 2647)
+++ trunk/src/dialogs.c 2008-06-05 16:42:28 UTC (rev 2648)
@@ -410,7 +410,6 @@
/* create a new tm_source_file object otherwise tagmanager won't work correctly */
tm_workspace_remove_object(documents[idx]->tm_file, TRUE, TRUE);
documents[idx]->tm_file = NULL;
- g_free(documents[idx]->file_name);
}
document_save_file_as(idx, utf8_filename);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2647
http://geany.svn.sourceforge.net/geany/?rev=2647&view=rev
Author: ntrel
Date: 2008-06-05 09:07:39 -0700 (Thu, 05 Jun 2008)
Log Message:
-----------
Update documentation for real_path, minor edit of file_name.
Modified Paths:
--------------
trunk/src/document.h
Modified: trunk/src/document.h
===================================================================
--- trunk/src/document.h 2008-06-05 14:05:55 UTC (rev 2646)
+++ trunk/src/document.h 2008-06-05 16:07:39 UTC (rev 2647)
@@ -70,10 +70,10 @@
gboolean is_valid;
/** Whether this %document support source code symbols(tags) to show in the sidebar. */
gboolean has_tags;
- /** The UTF-8 encoded file name. Be careful glibc and GLib functions expect the locale
- * representation of the file name which can be different from this.
- * For conversion into locale encoding for use with file functions of GLib, you can use
- * @ref utils_get_locale_from_utf8.
+ /** The UTF-8 encoded file name.
+ * Be careful; glibc and GLib file functions expect the locale representation of the
+ * file name which can be different from this.
+ * For conversion into locale encoding, you can use @ref utils_get_locale_from_utf8().
* @see real_path. */
gchar *file_name;
/** The encoding of the %document, must be a valid string representation of an encoding, can
@@ -109,7 +109,9 @@
* If non-NULL, this indicates the file once existed on disk (not just as an
* unsaved document with a filename set).
*
- * @note This is the same as: @c tm_get_real_path(doc->file_name); */
+ * @note This is only assigned after a successful save or open - it should
+ * not be set elsewhere.
+ * @see file_name. */
gchar *real_path;
}
GeanyDocument;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2646
http://geany.svn.sourceforge.net/geany/?rev=2646&view=rev
Author: eht16
Date: 2008-06-05 07:05:55 -0700 (Thu, 05 Jun 2008)
Log Message:
-----------
Add alternative build system: Waf.
Use wafinit.sh to create a Makefile and configure files.
Modified Paths:
--------------
trunk/ChangeLog
trunk/Makefile.am
Added Paths:
-----------
trunk/scripts/wafinit.sh
trunk/waf
trunk/wscript
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-06-05 12:43:10 UTC (rev 2645)
+++ trunk/ChangeLog 2008-06-05 14:05:55 UTC (rev 2646)
@@ -1,3 +1,10 @@
+2008-06-05 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
+
+ * Makefile.am, waf, wscript, scripts/wafinit.sh:
+ Add alternative build system: Waf.
+ Use wafinit.sh to create a Makefile and configure files.
+
+
2008-06-05 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/document.c:
Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am 2008-06-05 12:43:10 UTC (rev 2645)
+++ trunk/Makefile.am 2008-06-05 14:05:55 UTC (rev 2646)
@@ -22,6 +22,7 @@
EXTRA_DIST = \
autogen.sh \
+ wscript \
geany.desktop.in \
geany.pc.in \
geany.spec \
Added: trunk/scripts/wafinit.sh
===================================================================
--- trunk/scripts/wafinit.sh (rev 0)
+++ trunk/scripts/wafinit.sh 2008-06-05 14:05:55 UTC (rev 2646)
@@ -0,0 +1,53 @@
+#! /bin/sh
+#
+# This script creates a "configure" script and a Makefile to imitate autotools
+# but Waf is actually used to build
+
+WAF=`which waf`
+if [ "x$WAF" = "x" ]
+then
+ WAF="./waf"
+fi
+
+
+cat > Makefile << EOF
+
+.PHONY: build configure
+
+all: build
+
+build:
+ @$WAF build \$@
+
+install:
+ @$WAF install \$@
+
+uninstall:
+ @$WAF uninstall
+
+clean:
+ @$WAF clean
+
+distclean:
+ @$WAF distclean
+ @-rm -f Makefile
+
+htmldoc:
+ @$WAF --htmldoc
+
+apidoc:
+ @$WAF --apidoc
+
+configure:
+ @$WAF configure \$@
+
+EOF
+
+cat > configure << EOF
+#!/bin/sh
+
+$WAF configure \$@
+
+EOF
+
+chmod 755 configure
Property changes on: trunk/scripts/wafinit.sh
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/waf
===================================================================
--- trunk/waf (rev 0)
+++ trunk/waf 2008-06-05 14:05:55 UTC (rev 2646)
@@ -0,0 +1,145 @@
+#! /usr/bin/env python
+# encoding: utf-8
+# Thomas Nagy, 2005-2008
+
+"""
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+"""
+
+import os, sys
+if sys.hexversion<0x203000f: raise "Waf requires Python >= 2.3"
+
+if 'PSYCOWAF' in os.environ:
+ try:import psyco;psyco.full()
+ except:pass
+
+VERSION="1.4.2"
+REVISION="fd1f2e9d93f8e1634be8fb448b10b939"
+INSTALL=sys.platform=='win32' and 'c:/temp' or '/usr/local'
+cwd = os.getcwd()
+join = os.path.join
+
+def decode(s):
+ p1 = len(s)
+ s += '!!!!!'
+ w1 = [256**(3-u) for u in xrange(4)]
+ w2 = [(u, 85**(4-u)) for u in xrange(5)]
+ tot = [sum([(ord(s[i+m])-33) * n for (m, n) in w2]) for i in xrange(0, p1, 5)]
+ return ''.join([chr((y/x) & 255) for y in tot for x in w1])
+
+def err(m):
+ print '\033[91mError: %s\033[0m' % m
+ sys.exit(1)
+
+def unpack_wafdir(dir):
+ f = open(sys.argv[0],'rb')
+ c = "corrupted waf (%d)"
+ while 1:
+ line = f.readline()
+ if not line: err("run waf-light from a folder containing wafadmin")
+ if line == '#==>\n':
+ txt = f.readline()
+ if not txt: err(c % 1)
+ if f.readline()!='#<==\n': err(c % 2)
+ break
+ if not txt: err(c % 3)
+ try: txt = decode(txt[1:-1].replace('z', '!!!!!'))
+ except: err(c % 4)
+
+ import shutil, tarfile
+ try: shutil.rmtree(dir)
+ except OSError: pass
+ try: os.makedirs(join(dir, 'wafadmin', 'Tools'))
+ except OSError: err("Cannot unpack waf lib into %s\nMove waf into a writeable directory" % dir)
+
+ os.chdir(dir)
+ tmp = 't.tbz2'
+ t = open(tmp,'wb')
+ t.write(txt)
+ t.close()
+
+ t = tarfile.open(tmp)
+ for x in t: t.extract(x)
+ t.close()
+
+ os.chmod(join('wafadmin','Tools'), 0755)
+
+ os.unlink(tmp)
+ os.chdir(cwd)
+
+def test(dir):
+ try: os.stat(join(dir, 'wafadmin')); return os.path.abspath(dir)
+ except OSError: pass
+
+def find_lib():
+ name = sys.argv[0]
+ base = os.path.dirname(os.path.abspath(name))
+
+ #devs use $WAFDIR
+ w=test(os.environ.get('WAFDIR', ''))
+ if w: return w
+
+ #waf-light
+ if name.endswith('waf-light'):
+ w = test(base)
+ if w: return w
+ err("waf-light requires wafadmin -> export WAFDIR=/folder")
+
+ dir = "/lib/waf-%s-%s/" % (VERSION, REVISION)
+ for i in [INSTALL,'/usr','/usr/local','/opt']:
+ w = test(i+dir)
+ if w: return w
+
+ #waf-local
+ s = '.waf-%s-%s'
+ if sys.platform == 'win32': s = s[1:]
+ dir = join(base, s % (VERSION, REVISION))
+ w = test(dir)
+ if w: return w
+
+ #unpack
+ unpack_wafdir(dir)
+ return dir
+
+wafdir = find_lib()
+if "-vv" in sys.argv: print "wafdir is %s" % wafdir
+
+w = join(wafdir, 'wafadmin')
+t = join(w, 'Tools')
+sys.path = [w, t] + sys.path
+
+import Scripting, Params
+Params.g_tooldir = [t]
+Params.g_cwd_launch = cwd
+
+if Params.g_version != VERSION:
+ err('Version mismatch: waf %s <> wafadmin %s (wafdir %s)' % (VERSION, Params.g_version, wafdir))
+Scripting.prepare()
+
+#==>
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2645
http://geany.svn.sourceforge.net/geany/?rev=2645&view=rev
Author: ntrel
Date: 2008-06-05 05:43:10 -0700 (Thu, 05 Jun 2008)
Log Message:
-----------
Replace 2 macros only used locally with const char pointers.
Modified Paths:
--------------
trunk/src/document.c
trunk/src/main.c
Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c 2008-06-05 12:36:48 UTC (rev 2644)
+++ trunk/src/document.c 2008-06-05 12:43:10 UTC (rev 2645)
@@ -879,9 +879,10 @@
tmp_enc_idx == GEANY_ENCODING_UTF_7 || /* filter out UTF-7/8 and None where no NULL bytes */
tmp_enc_idx == GEANY_ENCODING_NONE)) /* are allowed */
{
-#define warn_msg _("The file \"%s\" could not be opened properly and has been truncated. " \
- "This can occur if the file contains a NULL byte. " \
- "Be aware that saving it can cause data loss.\nThe file was set to read-only.")
+ const gchar *warn_msg = _(
+ "The file \"%s\" could not be opened properly and has been truncated. " \
+ "This can occur if the file contains a NULL byte. " \
+ "Be aware that saving it can cause data loss.\nThe file was set to read-only.");
if (main_status.main_window_realized)
dialogs_show_msgbox(GTK_MESSAGE_WARNING, warn_msg, utf8_filename);
Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c 2008-06-05 12:36:48 UTC (rev 2644)
+++ trunk/src/main.c 2008-06-05 12:43:10 UTC (rev 2645)
@@ -692,7 +692,7 @@
}
else
{
-#define msg _("Could not find file '%s'.")
+ const gchar *msg = _("Could not find file '%s'.");
g_printerr(msg, filename); /* also print to the terminal */
g_printerr("\n");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2644
http://geany.svn.sourceforge.net/geany/?rev=2644&view=rev
Author: ntrel
Date: 2008-06-05 05:36:48 -0700 (Thu, 05 Jun 2008)
Log Message:
-----------
Only reorder recent files on closing documents that have existed on
disk.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/document.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-06-05 12:21:50 UTC (rev 2643)
+++ trunk/ChangeLog 2008-06-05 12:36:48 UTC (rev 2644)
@@ -6,6 +6,9 @@
* src/keyfile.c:
Only save session documents that have existed on disk (don't save
documents with a filename set but have never been saved).
+ * src/document.c:
+ Only reorder recent files on closing documents that have existed on
+ disk.
2008-06-04 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c 2008-06-05 12:21:50 UTC (rev 2643)
+++ trunk/src/document.c 2008-06-05 12:36:48 UTC (rev 2644)
@@ -536,8 +536,8 @@
{
return FALSE;
}
- /* TODO: check g_file_test(documents[idx]->real_name, G_FILE_TEST_EXISTS) */
- if (! main_status.closing_all && g_path_is_absolute(DOC_FILENAME(idx)))
+ /* Checking real_path makes it likely the file exists on disk */
+ if (! main_status.closing_all && documents[idx]->real_path != NULL)
ui_add_recent_file(documents[idx]->file_name);
notebook_remove_page(page_num);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2643
http://geany.svn.sourceforge.net/geany/?rev=2643&view=rev
Author: ntrel
Date: 2008-06-05 05:21:50 -0700 (Thu, 05 Jun 2008)
Log Message:
-----------
Only save session documents that have existed on disk (don't save
documents with a filename set but have never been saved).
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/keyfile.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-06-05 12:14:51 UTC (rev 2642)
+++ trunk/ChangeLog 2008-06-05 12:21:50 UTC (rev 2643)
@@ -3,6 +3,9 @@
* src/document.c:
Only set GeanyDocument::real_path when the file exists on disk -
after a successful save or open.
+ * src/keyfile.c:
+ Only save session documents that have existed on disk (don't save
+ documents with a filename set but have never been saved).
2008-06-04 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/keyfile.c
===================================================================
--- trunk/src/keyfile.c 2008-06-05 12:14:51 UTC (rev 2642)
+++ trunk/src/keyfile.c 2008-06-05 12:21:50 UTC (rev 2643)
@@ -152,7 +152,7 @@
for (i = 0; i < max; i++)
{
idx = document_get_n_idx(i);
- if (idx >= 0 && g_path_is_absolute(DOC_FILENAME(idx)))
+ if (idx >= 0 && documents[idx]->real_path != NULL)
{
gchar *fname;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2640
http://geany.svn.sourceforge.net/geany/?rev=2640&view=rev
Author: eht16
Date: 2008-06-04 06:23:43 -0700 (Wed, 04 Jun 2008)
Log Message:
-----------
Restore the previous state of main_status.quitting status when asking for reload a changed file instead of setting it to true. Oops.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/dialogs.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-06-03 18:15:52 UTC (rev 2639)
+++ trunk/ChangeLog 2008-06-04 13:23:43 UTC (rev 2640)
@@ -1,3 +1,10 @@
+2008-06-04 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
+
+ * src/dialogs.c:
+ Restore the previous state of main_status.quitting status when asking
+ for reload a changed file instead of setting it to true.
+
+
2008-06-03 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/build.c, src/dialogs.c, src/document.c, src/document.h,
Modified: trunk/src/dialogs.c
===================================================================
--- trunk/src/dialogs.c 2008-06-03 18:15:52 UTC (rev 2639)
+++ trunk/src/dialogs.c 2008-06-04 13:23:43 UTC (rev 2640)
@@ -667,12 +667,13 @@
#endif
gchar *msg, *msg2, *short_fn = NULL;
gint ret;
+ gboolean old_quitting_state = main_status.quitting;
/* display the file tab to remind the user of the document */
main_status.quitting = FALSE;
gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook),
document_get_notebook_page(idx));
- main_status.quitting = TRUE;
+ main_status.quitting = old_quitting_state;
if (documents[idx]->file_name != NULL)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.