BeOS updates. File deletion also deletes correct thumbnail and .dat file.

This commit is contained in:
William Kendrick 2004-11-22 00:18:12 +00:00
parent fcc43e7113
commit df94c7d071
2 changed files with 51 additions and 5 deletions

View file

@ -8,7 +8,13 @@ http://www.newbreedsoftware.com/tuxpaint/
2004.November.21 (0.9.15) 2004.November.21 (0.9.15)
* Update BeOS Makefile. * BeOS code updates.
Marcin 'Shard' Konicki <shard at beosjournal.org>
* Delete thumbnails from ".thumbs" subdirectory.
Marcin 'Shard' Konicki <shard at beosjournal.org>
* Updated BeOS Makefile.
Marcin 'Shard' Konicki <shard at beosjournal.org> Marcin 'Shard' Konicki <shard at beosjournal.org>
* Added BeOS resource file (src/tuxpaint.rsrc) * Added BeOS resource file (src/tuxpaint.rsrc)

View file

@ -21,12 +21,12 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
June 14, 2002 - October 24, 2004 June 14, 2002 - November 21, 2004
*/ */
#define VER_VERSION "0.9.15" #define VER_VERSION "0.9.15"
#define VER_DATE "2004-10-24" #define VER_DATE "2004-11-21"
/* #define DEBUG */ /* #define DEBUG */
@ -119,6 +119,16 @@
#include <dirent.h> #include <dirent.h>
#ifdef __BEOS__ #ifdef __BEOS__
#include "BeOS_print.h" #include "BeOS_print.h"
// workaround dirent handling bug in TuxPaint code
typedef struct safer_dirent {
dev_t d_dev;
dev_t d_pdev;
ino_t d_ino;
ino_t d_pino;
unsigned short d_reclen;
char d_name[NAME_MAX];
} safer_dirent;
#define dirent safer_dirent
#endif #endif
#ifdef __APPLE__ #ifdef __APPLE__
#include "macosx_print.h" #include "macosx_print.h"
@ -4070,6 +4080,9 @@ void setup(int argc, char * argv[])
/* if run from gui, like OpenTracker in BeOS or Explorer in Windows, /* if run from gui, like OpenTracker in BeOS or Explorer in Windows,
find path from which binary was run and change dir to it find path from which binary was run and change dir to it
so all files will be local :) */ so all files will be local :) */
/* UPDATE (2004.10.06): Since SDL 1.2.7 SDL sets that path correctly,
so this code wouldn't be needed if SDL was init before anything else,
(just basic init, window shouldn't be needed). */
if (argc && argv[0]) if (argc && argv[0])
{ {
@ -7634,7 +7647,7 @@ void reset_avail_tools(void)
#endif #endif
#ifdef __BEOS__ #ifdef __BEOS__
if(!IsPrinterAvailable()) disallow_print = 1; if(!IsPrinterAvailable()) disallow_print = disable_print = 1;
#endif #endif
@ -10690,6 +10703,20 @@ int do_open(int want_new_tool)
/* Delete the thumbnail, too: */ /* Delete the thumbnail, too: */
snprintf(fname, sizeof(fname),
"saved/.thumbs/%s-t.png",
d_names[which]);
free(rfname);
rfname = get_fname(fname);
debug(rfname);
unlink(rfname);
/* Try deleting old-style thumbnail, too: */
unlink(rfname);
snprintf(fname, sizeof(fname), "saved/%s-t.png", snprintf(fname, sizeof(fname), "saved/%s-t.png",
d_names[which]); d_names[which]);
@ -10700,6 +10727,19 @@ int do_open(int want_new_tool)
unlink(rfname); unlink(rfname);
/* Delete .dat file, if any: */
unlink(rfname);
snprintf(fname, sizeof(fname), "saved/%s.dat",
d_names[which]);
free(rfname);
rfname = get_fname(fname);
debug(rfname);
unlink(rfname);
/* Move all other files up a notch: */ /* Move all other files up a notch: */
free(d_names[which]); free(d_names[which]);
@ -12858,7 +12898,7 @@ void load_starter(char * img_id)
/* Determine path to starter files: */ /* Determine path to starter files: */
/* FIXME: On Windows, MacOSX, BeOS, etc. -- do it their way! */ /* FIXME: On Windows, MacOSX, BeOS, etc. -- do it their way! */
#ifdef WIN32 #if defined(WIN32) || defined(__BEOS__)
dirname = strdup(DATA_PREFIX "starters"); dirname = strdup(DATA_PREFIX "starters");
#else #else
dirname = strdup("/usr/local/share/tuxpaint/starters"); dirname = strdup("/usr/local/share/tuxpaint/starters");