r17554 by craig - Add plain download type that does not get unzipped just moved into place. Now use http://cgit.freedesktop.org/libreoffice/dictionaries/tree/dictionaries for dict source
scribus-commit
scribus-commit at lists.scribus.net
Mon Jun 11 20:35:49 UTC 2012
Author: craig
Date: Mon Jun 11 20:35:49 2012
New Revision: 17554
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17554
Log:
Add plain download type that does not get unzipped just moved into place. Now use http://cgit.freedesktop.org/libreoffice/dictionaries/tree/dictionaries for dict source
Modified:
branches/Version14x/Scribus/scribus/hysettings.cpp
branches/Version14x/Scribus/scribus/hysettings.h
branches/Version14x/Scribus/scribus/langmgr.cpp
branches/Version14x/Scribus/scribus/ui/downloaddictionaries.h
Modified: branches/Version14x/Scribus/scribus/hysettings.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17554&path=/branches/Version14x/Scribus/scribus/hysettings.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/hysettings.cpp (original)
+++ branches/Version14x/Scribus/scribus/hysettings.cpp Mon Jun 11 20:35:49 2012
@@ -12,7 +12,7 @@
#include "scribusdoc.h"
#include "util_icon.h"
#include "util.h"
-#include "ui/downloaddictionaries.h"
+#include "util_file.h"
#include "scpaths.h"
#include <QDomDocument>
#include <QHeaderView>
@@ -182,9 +182,21 @@
{
if (dlLangs.contains(d.lang))
{
- ScQApp->dlManager()->addURL(d.url, true, downloadLocation);
- downloadList.append(d);
- ++i;
+ if (d.filetype=="zip")
+ {
+ ScQApp->dlManager()->addURL(d.url, true, downloadLocation);
+ downloadList.append(d);
+ ++i;
+ }
+ if (d.filetype=="plain")
+ {
+ //qDebug()<<d.url<<d.files;
+ QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
+ foreach (QString s, plainURLs)
+ ScQApp->dlManager()->addURL(d.url+"/"+s, true, downloadLocation);
+ downloadList.append(d);
+ ++i;
+ }
}
}
if (i>0)
@@ -251,16 +263,29 @@
foreach(DictData d, downloadList)
{
QString basename = QFileInfo(d.url).fileName();
- QString filename=downloadLocation+"/"+basename;
+ QString filename=downloadLocation+basename;
//qDebug()<<filename;
- FileUnzip* fun = new FileUnzip(filename);
- QStringList files=d.files.split(";", QString::SkipEmptyParts);
- foreach (QString s, files)
+ if (d.filetype=="zip")
{
- qDebug()<<"Unzipping"<<userDictDir+s;
- QString data=fun->getFile(s, userDictDir);
+ //qDebug()<<"zip data found"<<filename;
+ FileUnzip* fun = new FileUnzip(filename);
+ QStringList files=d.files.split(";", QString::SkipEmptyParts);
+ foreach (QString s, files)
+ {
+ //qDebug()<<"Unzipping"<<userDictDir+s;
+ QString data=fun->getFile(s, userDictDir);
+ }
+ delete fun;
}
- delete fun;
+ if (d.filetype=="plain")
+ {
+ QStringList files=d.files.split(";", QString::SkipEmptyParts);
+ foreach (QString s, files)
+ {
+ //qDebug()<<"plain data found"<<downloadLocation<<userDictDir<<s;
+ moveFile(downloadLocation+s, userDictDir+s);
+ }
+ }
}
updateDictList();
}
@@ -293,7 +318,7 @@
if( !e.isNull() ) {
if (e.tagName()=="dictionary")
{
- if (e.hasAttribute("type"))
+ if (e.hasAttribute("type") && e.hasAttribute("filetype"))
{
if (e.attribute("type")=="spell")
{
@@ -305,6 +330,7 @@
d.version=e.attribute("version");
d.lang=e.attribute("language");
d.license=e.attribute("license");
+ d.filetype=e.attribute("filetype");
QUrl url(d.url);
if (url.isValid() && !url.isEmpty() && !url.host().isEmpty())
dictList.append(d);
Modified: branches/Version14x/Scribus/scribus/hysettings.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17554&path=/branches/Version14x/Scribus/scribus/hysettings.h
==============================================================================
--- branches/Version14x/Scribus/scribus/hysettings.h (original)
+++ branches/Version14x/Scribus/scribus/hysettings.h Mon Jun 11 20:35:49 2012
@@ -26,6 +26,7 @@
QString url;
QString desc;
QString license;
+ QString filetype;
bool download;
};
Modified: branches/Version14x/Scribus/scribus/langmgr.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17554&path=/branches/Version14x/Scribus/scribus/langmgr.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/langmgr.cpp (original)
+++ branches/Version14x/Scribus/scribus/langmgr.cpp Mon Jun 11 20:35:49 2012
@@ -56,56 +56,64 @@
// TODO get rid of the redundant key, the english name.
// So internally language would always be manipulated as a code and otherwise presented translated.
langList.insert("af", langPair("Afrikaans", QObject::tr( "Afrikaans" )) );
+ langList.insert("af_ZA", langPair("Afrikaans", QObject::tr( "Afrikaans" )) );
+ langList.insert("an_ES", langPair("Aragonese", QObject::tr( "Aragonese" )) );
langList.insert("ar", langPair("Arabic", QObject::tr( "Arabic" )) );
- langList.insert("sq", langPair("Albanian", QObject::tr( "Albanian" )) );
- langList.insert("eu", langPair("Basque", QObject::tr( "Basque" )) );
+ langList.insert("be_BY", langPair("Belarusian", QObject::tr( "Belarusian" )) );
+ langList.insert("bg", langPair("Bulgarian", QObject::tr( "Bulgarian" )) );
+ langList.insert("bg_BG", langPair("Bulgarian", QObject::tr( "Bulgarian" )) );
langList.insert("bn", langPair("Bengali", QObject::tr( "Bengali" )) );
langList.insert("br", langPair("Breton", QObject::tr( "Breton" )) );
- langList.insert("bg", langPair("Bulgarian", QObject::tr( "Bulgarian" )) );
langList.insert("ca", langPair("Catalan", QObject::tr( "Catalan" )) );
- langList.insert("zh", langPair("Chinese", QObject::tr( "Chinese" )) );
- langList.insert("zh_TW", langPair("Chinese (Trad.)", QObject::tr( "Chinese (Trad.)" )) );
- langList.insert("hr", langPair("Croatian", QObject::tr( "Croatian" )) );
langList.insert("cs", langPair("Czech", QObject::tr( "Czech" )) );
langList.insert("cs_CZ", langPair("Czech", QObject::tr( "Czech" )) );
+ langList.insert("cy", langPair("Welsh", QObject::tr( "Welsh" )) );
langList.insert("da", langPair("Danish", QObject::tr( "Danish" )) );
langList.insert("da_DK", langPair("Danish", QObject::tr( "Danish" )) );
+ langList.insert("de", langPair("German", QObject::tr( "German" )) );
+ langList.insert("de_1901", langPair("German (Trad.)", QObject::tr( "German (Trad.)" )) );
+ langList.insert("de_CH", langPair("German (Swiss)", QObject::tr( "German (Swiss)" )) );
+ langList.insert("de_DE", langPair("German", QObject::tr( "German" )) );
langList.insert("dz", langPair("Dzongkha", QObject::tr( "Dzongkha" )) );
- langList.insert("nl", langPair("Dutch", QObject::tr( "Dutch" )) );
+ langList.insert("el", langPair("Greek", QObject::tr( "Greek" )) );
langList.insert("en", langPair("English", QObject::tr( "English" )) );
- langList.insert("en_AU", langPair("English (Australian)",QObject::tr( "English (Australian)" )) );
- langList.insert("en_CA", langPair("English (Canadian)", QObject::tr( "English (Canadian)" )) );
- langList.insert("en_GB", langPair("English (British)", QObject::tr( "English (British)" )) );
+ langList.insert("en_AU", langPair("English (Australia)", QObject::tr( "English (Australian)" )) );
+ langList.insert("en_CA", langPair("English (Canada)", QObject::tr( "English (Canadian)" )) );
+ langList.insert("en_GB", langPair("English (UK)", QObject::tr( "English (UK)" )) );
langList.insert("en_NZ", langPair("English (New Zealand)",QObject::tr( "English (New Zealand)" )) );
- langList.insert("en_US", langPair("English (American)", QObject::tr( "English (American)" )) );
+ langList.insert("en_US", langPair("English (USA)", QObject::tr( "English (USA)" )) );
langList.insert("en_ZA", langPair("English (South African)", QObject::tr( "English (South African)" )) );
langList.insert("eo", langPair("Esperanto", QObject::tr( "Esperanto" )) );
+ langList.insert("es", langPair("Spanish", QObject::tr( "Spanish" )) );
+ langList.insert("es_AR", langPair("Spanish (Argentina)", QObject::tr( "Spanish (Argentina)" )) );
+ langList.insert("es_ES", langPair("Spanish", QObject::tr( "Spanish" )) );
+ langList.insert("es_LA", langPair("Spanish (Latin)", QObject::tr( "Spanish (Latin)" )) );
langList.insert("et", langPair("Estonian", QObject::tr( "Estonian" )) );
- langList.insert("de", langPair("German", QObject::tr( "German" )) );
- langList.insert("de_CH", langPair("German (Swiss)", QObject::tr( "German (Swiss)" )) );
- langList.insert("de_1901", langPair("German (Trad.)", QObject::tr( "German (Trad.)" )) );
+ langList.insert("eu", langPair("Basque", QObject::tr( "Basque" )) );
langList.insert("fi", langPair("Finnish", QObject::tr( "Finnish" )) );
langList.insert("fr", langPair("French", QObject::tr( "French" )) );
+ langList.insert("fr_FR", langPair("French", QObject::tr( "French" )) );
langList.insert("gl", langPair("Galician", QObject::tr( "Galician" )) );
- langList.insert("el", langPair("Greek", QObject::tr( "Greek" )) );
langList.insert("he", langPair("Hebrew", QObject::tr( "Hebrew" )) );
+ langList.insert("hr", langPair("Croatian", QObject::tr( "Croatian" )) );
langList.insert("hu", langPair("Hungarian", QObject::tr( "Hungarian" )) );
langList.insert("ia", langPair("Latin", QObject::tr( "Latin" )) );
+ langList.insert("id", langPair("Indonesian", QObject::tr( "Indonesian" )) );
langList.insert("is", langPair("Icelandic", QObject::tr( "Icelandic" )) );
- langList.insert("id", langPair("Indonesian", QObject::tr( "Indonesian" )) );
langList.insert("it", langPair("Italian", QObject::tr( "Italian" )) );
+ langList.insert("it_IT", langPair("Italian", QObject::tr( "Italian" )) );
langList.insert("ja", langPair("Japanese", QObject::tr( "Japanese" )) );
langList.insert("km", langPair("Khmer", QObject::tr( "Khmer" )) );
langList.insert("ko", langPair("Korean", QObject::tr( "Korean" )) );
langList.insert("ku", langPair("Kurdish", QObject::tr( "Kurdish" )) );
+ langList.insert("la", langPair("Latin", QObject::tr( "Latin" )) );
+ langList.insert("lb", langPair("Luxembourgish", QObject::tr( "Luxembourgish" )) );
langList.insert("lo", langPair("Lao", QObject::tr( "Lao" )) );
- langList.insert("la", langPair("Latin", QObject::tr( "Latin" )) );
langList.insert("lt", langPair("Lithuanian", QObject::tr( "Lithuanian" )) );
langList.insert("lt_LT", langPair("Lithuanian", QObject::tr( "Lithuanian" )) );
- langList.insert("lu", langPair("Luxembourgish", QObject::tr( "Luxembourgish" )) );
- //We might need �E5; for this accented a
langList.insert("nb", langPair("Norwegian (Bokmål)", QObject::trUtf8( "Norwegian (Bokm\303\245l)" )) );
langList.insert("nb_NO", langPair("Norwegian (Bokmål)", QObject::trUtf8( "Norwegian (Bokm\303\245l)" )) );
+ langList.insert("nl", langPair("Dutch", QObject::tr( "Dutch" )) );
langList.insert("nn", langPair("Norwegian (Nnyorsk)", QObject::tr( "Norwegian (Nnyorsk)" )) );
langList.insert("nn_NO", langPair("Norwegian (Nnyorsk)", QObject::tr( "Norwegian (Nnyorsk)" )) );
langList.insert("no", langPair("Norwegian", QObject::tr( "Norwegian" )) );
@@ -117,13 +125,10 @@
langList.insert("ro", langPair("Romanian", QObject::tr( "Romanian" )) );
langList.insert("ru", langPair("Russian", QObject::tr( "Russian" )) );
langList.insert("sa", langPair("Sanskrit", QObject::tr( "Sanskrit" )) );
- langList.insert("es", langPair("Spanish", QObject::tr( "Spanish" )) );
- langList.insert("es_AR", langPair("Spanish (Argentina)", QObject::tr( "Spanish (Argentina)" )) );
- langList.insert("es_ES", langPair("Spanish", QObject::tr( "Spanish" )) );
- langList.insert("es_LA", langPair("Spanish (Latin)", QObject::tr( "Spanish (Latin)" )) );
langList.insert("sk", langPair("Slovak", QObject::tr( "Slovak" )) );
langList.insert("sk_SK", langPair("Slovak", QObject::tr( "Slovak" )) );
langList.insert("sl", langPair("Slovenian", QObject::tr( "Slovenian" )) );
+ langList.insert("sq", langPair("Albanian", QObject::tr( "Albanian" )) );
langList.insert("sr", langPair("Serbian", QObject::tr( "Serbian" )) );
langList.insert("sv", langPair("Swedish", QObject::tr( "Swedish" )) );
langList.insert("th", langPair("Thai", QObject::tr( "Thai" )) );
@@ -133,7 +138,9 @@
langList.insert("uk", langPair("Ukranian", QObject::tr( "Ukranian" )) );
langList.insert("uk_UA", langPair("Ukranian", QObject::tr( "Ukranian" )) );
langList.insert("vi", langPair("Vietnamese", QObject::tr( "Vietnamese" )) );
- langList.insert("cy", langPair("Welsh", QObject::tr( "Welsh" )) );
+ langList.insert("zh", langPair("Chinese", QObject::tr( "Chinese" )) );
+ langList.insert("zh_TW", langPair("Chinese (Trad.)", QObject::tr( "Chinese (Trad.)" )) );
+
}
void LanguageManager::generateInstalledLangList()
Modified: branches/Version14x/Scribus/scribus/ui/downloaddictionaries.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17554&path=/branches/Version14x/Scribus/scribus/ui/downloaddictionaries.h
==============================================================================
--- branches/Version14x/Scribus/scribus/ui/downloaddictionaries.h (original)
+++ branches/Version14x/Scribus/scribus/ui/downloaddictionaries.h Mon Jun 11 20:35:49 2012
@@ -26,6 +26,7 @@
QString url;
QString desc;
QString license;
+ QString filetype;
bool download;
};
More information about the scribus-commit
mailing list