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

« back to all changes in this revision

Viewing changes to scribus/helpbrowser.cpp

  • Committer: Package Import Robot
  • Author(s): Oleksandr Moskalenko
  • Date: 2012-02-09 21:50:56 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120209215056-2wrx1ara0jbm7fi5
Tags: 1.4.0.dfsg+r17287-1
* New upstream stable release upload into Debian (Closes: #654703).
* Applied the Ubuntu armel patch.
* Removed non-free color swatches from resources.
* debian/control:
  - Moved icc-profiles from Recommends to Suggests (Closes: #655885).
  - Updated Standards-Version to 3.9.2.
  - Updated extended description per lintian warning.
* debian/rules:
  - Update mailcap (Closes: #630751). A request for mime.types update has
    been sent to the mime-support maintainer.
  - Added build-arch and build-indep targets per lintian warning.
* debian/patches:
  - top_cmakelists.patch - don't copy extra docs and changelogs.
  - scribus_cmakelists.patch - don't copy extra docs and changelogs.
  - scribus_cmakelists.patch - don't install the non-free "doc" dir.
  - profiles_cmakelists.patch - don't install non-free sRGB profile.
* debian/copyright: 
  - Converted to the DEP5 machine readable foramt.
  - Added licenses for free color swatches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
336
336
 
337
337
void HelpBrowser::searchingInDirectory(const QString& aDir)
338
338
{
339
 
        QDir dir(QDir::convertSeparators(aDir + "/"));
 
339
        QDir dir(QDir::toNativeSeparators(aDir + "/"));
340
340
        QStringList in;
341
341
        in.append("*.html");
342
342
        QStringList lst = dir.entryList(in);
370
370
        QStringList dst = dir.entryList(in, QDir::Dirs);
371
371
        for (QStringList::Iterator it = dst.begin(); it != dst.end(); ++it)
372
372
                if ((*it)!="." && (*it)!="..")
373
 
                        searchingInDirectory(QDir::convertSeparators(aDir + QString((*it)) + "/"));
 
373
                        searchingInDirectory(QDir::toNativeSeparators(aDir + QString((*it)) + "/"));
374
374
}
375
375
 
376
376
void HelpBrowser::find()
412
412
        if (title.isNull())
413
413
                return;
414
414
        //TODO: start storing full paths
415
 
        QString toFind(fname.remove(QDir::convertSeparators(finalBaseDir)));
 
415
        QString toFind(fname.remove(QDir::toNativeSeparators(finalBaseDir)));
416
416
        toFind=toFind.mid(1, toFind.length()-1);
417
417
        QMapIterator<QString, QString> i(quickHelpIndex);
418
418
        while (i.hasNext())
499
499
                        toLoad=filename;
500
500
                else
501
501
                {
502
 
                        toLoad = QDir::convertSeparators(ScPaths::instance().docDir() + "en/index.html");
 
502
                        toLoad = QDir::toNativeSeparators(ScPaths::instance().docDir() + "en/index.html");
503
503
//                      language="en";
504
504
                        fi = QFileInfo(toLoad);
505
505
                        if (!fi.exists())
533
533
{
534
534
        QString baseHelpDir = ScPaths::instance().docDir();
535
535
        QString altHelpDir  = ScPaths::instance().getApplicationDataDir();
536
 
        QString baseHelpMenuFile = QDir::convertSeparators(baseHelpDir + language + "/menu.xml");
537
 
        QString altHelpMenuFile = QDir::convertSeparators(altHelpDir + "doc/" + language + "/menu.xml");
 
536
        QString baseHelpMenuFile = QDir::toNativeSeparators(baseHelpDir + language + "/menu.xml");
 
537
        QString altHelpMenuFile = QDir::toNativeSeparators(altHelpDir + "doc/" + language + "/menu.xml");
538
538
        QFileInfo baseFi = QFileInfo(baseHelpMenuFile);
539
539
        QFileInfo altFi = QFileInfo(altHelpMenuFile);
540
540
        QString toLoad = baseHelpMenuFile;
550
550
                        if (!language.isEmpty())
551
551
                        {
552
552
                                //Check if we can load, eg "de" when "de_CH" docs dont exist
553
 
                                QString baseHelpMenuFile3 = QDir::convertSeparators(baseHelpDir + language.left(2) + "/menu.xml");
554
 
                                QString altHelpMenuFile3 = QDir::convertSeparators(altHelpDir + "doc/" + language.left(2) + "/menu.xml");
 
553
                                QString baseHelpMenuFile3 = QDir::toNativeSeparators(baseHelpDir + language.left(2) + "/menu.xml");
 
554
                                QString altHelpMenuFile3 = QDir::toNativeSeparators(altHelpDir + "doc/" + language.left(2) + "/menu.xml");
555
555
                                QFileInfo fi3 = QFileInfo(baseHelpMenuFile3);
556
556
                                QFileInfo altfi3 = QFileInfo(altHelpMenuFile3);
557
557
                                if (fi3.exists())
558
558
                                {
559
559
                                        language=language.left(2);
560
 
                                        toLoad = QDir::convertSeparators(baseHelpMenuFile3);
 
560
                                        toLoad = QDir::toNativeSeparators(baseHelpMenuFile3);
561
561
                                }
562
562
                                else
563
563
                                if (altfi3.exists())
564
564
                                {
565
565
                                        language=language.left(2);
566
 
                                        toLoad = QDir::convertSeparators(altHelpMenuFile3);
 
566
                                        toLoad = QDir::toNativeSeparators(altHelpMenuFile3);
567
567
                                }
568
568
                                else
569
569
                                {
570
570
                                        //Fall back to English
571
571
                                        sDebug("Scribus help in your selected language does not exist, trying English. Otherwise, please visit http://docs.scribus.net.");
572
572
                                        language="en";
573
 
                                        toLoad = QDir::convertSeparators(baseHelpDir + language + "/menu.xml");
 
573
                                        toLoad = QDir::toNativeSeparators(baseHelpDir + language + "/menu.xml");
574
574
                                }
575
575
                        }
576
576
                        else
577
577
                        {
578
578
                                language="en";
579
 
                                toLoad = QDir::convertSeparators(baseHelpDir + language + "/menu.xml");
 
579
                                toLoad = QDir::toNativeSeparators(baseHelpDir + language + "/menu.xml");
580
580
                        }
581
581
                        baseFi = QFileInfo(toLoad);
582
582
                }
691
691
        QString fname(appDataDir + "doc/bookmarks.xml");
692
692
        if (!QFile::exists(fname))
693
693
        {
694
 
                QDir d(QDir::convertSeparators(appDataDir));
 
694
                QDir d(QDir::toNativeSeparators(appDataDir));
695
695
                d.mkdir("doc");
696
696
        }
697
697
        return fname;
708
708
        QString fname(appDataDir + "doc/history.xml");
709
709
        if (!QFile::exists(fname))
710
710
        {
711
 
                QDir d(QDir::convertSeparators(appDataDir));
 
711
                QDir d(QDir::toNativeSeparators(appDataDir));
712
712
                d.mkdir("doc");
713
713
        }
714
714
        return fname;