~ubuntu-branches/ubuntu/trusty/krusader/trusty

« back to all changes in this revision

Viewing changes to krusader/VFS/normal_vfs.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-08-08 13:47:36 UTC
  • mfrom: (1.2.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20110808134736-8e630ivgd2c3sgg5
Tags: 1:2.4.0~beta1-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
259
259
    KDE_struct_stat stat_p;
260
260
    stat_p.st_size = 0;
261
261
    stat_p.st_mode = 0;
 
262
    stat_p.st_mtime = 0;
 
263
    stat_p.st_uid = 0;
 
264
    stat_p.st_gid = 0;
262
265
    KDE_lstat(fileName.data(), &stat_p);
263
266
    KIO::filesize_t size = stat_p.st_size;
264
267
    QString perm = KRpermHandler::mode2QString(stat_p.st_mode);
265
268
    bool symLink = S_ISLNK(stat_p.st_mode);
 
269
    bool brokenLink = false;
266
270
    if (S_ISDIR(stat_p.st_mode)) perm[0] = 'd';
267
271
 
268
272
    KUrl mimeUrl = KUrl(path);
274
278
        int endOfName = 0;
275
279
        endOfName = readlink(fileName.data(), symDest, 256);
276
280
        if (endOfName != -1) {
277
 
            if (QDir(QString::fromLocal8Bit(symDest)).exists()) perm[0] = 'd';
278
 
            if (!QDir(vfs_workingDir()).exists(QString::fromLocal8Bit(symDest))) mime = "Broken Link !";
279
 
        } else krOut << "Failed to read link: " << path << endl;
 
281
            if (QDir(QString::fromLocal8Bit(symDest)).exists())
 
282
                perm[0] = 'd';
 
283
            if (!QDir(vfs_workingDir()).exists(QString::fromLocal8Bit(symDest)))
 
284
                brokenLink = true;
 
285
        } else
 
286
            krOut << "Failed to read link: " << path << endl;
280
287
    }
281
288
 
282
289
    int rwx = 0;
291
298
#endif
292
299
 
293
300
    // create a new virtual file object
294
 
    vfile* temp = new vfile(name, size, perm, stat_p.st_mtime, symLink, stat_p.st_uid,
 
301
    vfile* temp = new vfile(name, size, perm, stat_p.st_mtime, symLink, brokenLink, stat_p.st_uid,
295
302
                            stat_p.st_gid, mime, QString::fromLocal8Bit(symDest), stat_p.st_mode, rwx);
296
303
    temp->vfile_setUrl(mimeUrl);
297
304
    return temp;