~ubuntu-branches/ubuntu/wily/scribus/wily-proposed

« back to all changes in this revision

Viewing changes to scribus/scfonts.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Oleksandr Moskalenko
  • Date: 2009-01-23 16:19:28 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090123161928-15mux08ba81ouz2p
Tags: 1.3.3.13.dfsg~svn20081228-2
debian/control: Fix a typo on build depends that somehow passed through
my pbuilder test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#include "prefscontext.h"
39
39
#include "prefstable.h"
40
40
#include "scribus.h"
 
41
#include "scribusapp.h"
41
42
#ifdef Q_WS_X11
42
43
#include <X11/X.h>
43
44
#include <X11/Xlib.h>
630
631
        if (path.isEmpty())
631
632
                return;
632
633
        FT_Library library = NULL;
633
 
        QString pathfile;
 
634
        QString pathfile, fullpath;
634
635
        bool error;
635
636
        error = FT_Init_FreeType( &library );
636
637
        QString pathname(path);
646
647
                        // over. Skip 'em.
647
648
                        if (d[dc] == "." || d[dc] == "..")
648
649
                                continue;
 
650
                        fullpath = pathname+d[dc];
649
651
                        QFileInfo fi(pathname+d[dc]);
650
652
                        if (!fi.exists())      // Sanity check for broken Symlinks
651
653
                                continue;
652
654
                        
653
655
                        qApp->processEvents();
654
656
                        
655
 
                        if (fi.isSymLink())
 
657
                        bool symlink = fi.isSymLink();
 
658
                        if (symlink)
656
659
                        {
657
660
                                QFileInfo fi3(fi.readLink());
658
661
                                if (fi3.isRelative())
661
664
                                        pathfile = fi3.absFilePath();
662
665
                        }
663
666
                        else
664
 
                                pathfile = pathname+d[dc];
 
667
                                pathfile = fullpath;
665
668
                        QFileInfo fi2(pathfile);
666
669
                        if (fi2.isDir()) 
667
670
                        {
 
671
                                if (symlink)
 
672
                                {
 
673
                                        // Check if symlink points to a parent directory
 
674
                                        // in order to avoid infinite recursion
 
675
                                        QString fullpath2 = fullpath, pathfile2 = pathfile;
 
676
                                        if (ScQApp->isWinGUI())
 
677
                                        {
 
678
                                                // Ensure both path use same separators on Windows
 
679
                                                // Arghhh!!! in Qt3 QFileInfo::absFilePath() may return old DOS-style paths
 
680
                                                fullpath2 = getShortPathName( QDir::convertSeparators(fullpath2) ).lower();
 
681
                                                pathfile2 = getShortPathName( QDir::convertSeparators(pathfile2) ).lower();
 
682
                                        }
 
683
                                        if (fullpath2.startsWith(pathfile2))
 
684
                                                continue;
 
685
                                }
668
686
                                if (DocName.isEmpty())
669
687
                                        AddScalableFonts(pathfile);
670
688
                                continue;