~ubuntu-branches/ubuntu/jaunty/gpicview/jaunty

« back to all changes in this revision

Viewing changes to src/image-list.c

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Lee
  • Date: 2008-09-12 01:43:21 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080912014321-zyxoac1aygvpdyjo
Tags: 0.1.10-1
* New upstream release
  - Solved assertion `GTK_IS_TOOLTIPS (tooltips)' failed problem
  - Added new translations
  - Fixed memory leaks
  - Fixed JPEG Rotation, rotation only in EXIF data
  - Fixed fullscreen toggles
  - Fixed order for file listing 
  - Security fixes CVE-2008-3904, CVE-2008-3791
  - Solved empty file problem in unsupported format
* Applied disable_ask_before_save.dpatch (Closes: #497005) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
 
82
82
gboolean image_list_open_dir( ImageList* il, const char* path, GError** error )
83
83
{
 
84
    const char* name = NULL;
 
85
    GDir* dir;
 
86
    struct stat stbuf;
 
87
 
84
88
    if( il->dir_path && 0 == strcmp( path, il->dir_path ) )
85
89
        return TRUE;
86
90
 
87
91
    image_list_close( il );
88
92
 
89
 
    GDir* dir = g_dir_open( path, 0, error );
 
93
    if( stat( path, &stbuf ) == -1 )
 
94
        return FALSE;
 
95
 
 
96
    dir = g_dir_open( path, 0, error );
90
97
    if( ! dir )
91
98
        return FALSE;
92
99
 
93
100
    il->dir_path = g_strdup( path );
 
101
    il->mtime = stbuf.st_mtime;
94
102
 
95
 
    const char* name = NULL;
96
103
    while( ( name = g_dir_read_name ( dir ) ) )
97
104
    {
98
105
//        char* file_path = g_build_filename( dir_path, name, NULL );
155
162
    g_list_foreach( il->list, (GFunc)g_free, NULL );
156
163
    g_list_free( il->list );
157
164
    il->list = NULL;
 
165
    il->mtime = 0;
158
166
 
159
167
    g_free( il->dir_path );
160
168
    il->dir_path = NULL;