r21897 by craig - #14679: Adjust the way language lists are shown in Doc Setup and fix a potential crash bug and clean API
scribus-commit
scribus-commit at lists.scribus.net
Fri Apr 14 21:13:37 UTC 2017
Author: craig
Date: Fri Apr 14 21:13:37 2017
New Revision: 21897
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21897
Log:
#14679: Adjust the way language lists are shown in Doc Setup and fix a potential crash bug and clean API
Modified:
trunk/Scribus/scribus/langdef.h
trunk/Scribus/scribus/langmgr.cpp
trunk/Scribus/scribus/langmgr.h
trunk/Scribus/scribus/ui/prefs_documentsetup.cpp
trunk/Scribus/scribus/ui/prefs_userinterface.cpp
trunk/Scribus/scribus/ui/propertiespalette_text.cpp
trunk/Scribus/scribus/ui/smcstylewidget.cpp
Modified: trunk/Scribus/scribus/langdef.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21897&path=/trunk/Scribus/scribus/langdef.h
==============================================================================
--- trunk/Scribus/scribus/langdef.h (original)
+++ trunk/Scribus/scribus/langdef.h Fri Apr 14 21:13:37 2017
@@ -31,7 +31,7 @@
public:
LangDef();
LangDef(const QString& pri, const QString& alt, const QString& name, const QString& transName);
- ~LangDef() {};
+ ~LangDef() {}
QString m_priAbbrev;
QString m_altAbbrev;
Modified: trunk/Scribus/scribus/langmgr.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21897&path=/trunk/Scribus/scribus/langmgr.cpp
==============================================================================
--- trunk/Scribus/scribus/langmgr.cpp (original)
+++ trunk/Scribus/scribus/langmgr.cpp Fri Apr 14 21:13:37 2017
@@ -818,39 +818,45 @@
return "";
}
-void LanguageManager::fillInstalledStringList(QStringList *stringListToFill, bool addDefaults)
-{
- if (stringListToFill)
- {
- for (int i = 0; i < m_langTable.size(); ++i)
+void LanguageManager::fillInstalledStringList(QStringList *stringListToFill)
+{
+ if (!stringListToFill)
+ return;
+ for (int i = 0; i < m_langTable.size(); ++i)
+ stringListToFill->append(m_langTable[i].m_transName);
+}
+
+void LanguageManager::fillInstalledGUIStringList(QStringList *stringListToFill)
+{
+ if (!stringListToFill)
+ return;
+ for (int i = 0; i < m_langTable.size(); ++i)
+ {
+ if (m_langTable[i].m_transAvailable)
stringListToFill->append(m_langTable[i].m_transName);
}
}
-void LanguageManager::fillInstalledGUIStringList(QStringList *stringListToFill, bool addDefaults)
-{
- if (stringListToFill)
- {
- for (int i = 0; i < m_langTable.size(); ++i)
- {
- //qDebug()<<langTable[i].m_transName<<langTable[i].m_transAvailable;
- if (m_langTable[i].m_transAvailable)
- stringListToFill->append(m_langTable[i].m_transName);
- }
- stringListToFill->sort();
- }
-}
-
void LanguageManager::fillInstalledHyphStringList(QStringList *stringListToFill)
{
- if (stringListToFill)
- {
- for (int i = 0; i < m_langTable.size(); ++i)
- {
- //qDebug()<<langTable[i].m_transName<<langTable[i].m_hyphAvailable;
- if (m_langTable[i].m_hyphAvailable)
- stringListToFill->append(m_langTable[i].m_transName);
- }
+ if (!stringListToFill)
+ return;
+ for (int i = 0; i < m_langTable.size(); ++i)
+ {
+ if (m_langTable[i].m_hyphAvailable)
+ stringListToFill->append(m_langTable[i].m_transName);
+ }
+ stringListToFill->sort();
+}
+
+void LanguageManager::fillInstalledSpellStringList(QStringList *stringListToFill)
+{
+ if (!stringListToFill)
+ return;
+ for (int i = 0; i < m_langTable.size(); ++i)
+ {
+ if (m_langTable[i].m_spellAvailable)
+ stringListToFill->append(m_langTable[i].m_transName);
}
stringListToFill->sort();
}
Modified: trunk/Scribus/scribus/langmgr.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21897&path=/trunk/Scribus/scribus/langmgr.h
==============================================================================
--- trunk/Scribus/scribus/langmgr.h (original)
+++ trunk/Scribus/scribus/langmgr.h Fri Apr 14 21:13:37 2017
@@ -52,9 +52,10 @@
const QString getTransLangFromLang(QString lang);
const QString getShortAbbrevFromAbbrev(QString langAbbrev);
const QString getAlternativeAbbrevfromAbbrev(QString langAbbrev);
- void fillInstalledStringList(QStringList *stringListToFill, bool addDefaults);
- void fillInstalledGUIStringList(QStringList *stringListToFill, bool addDefaults);
+ void fillInstalledStringList(QStringList *stringListToFill);
+ void fillInstalledGUIStringList(QStringList *stringListToFill);
void fillInstalledHyphStringList(QStringList *stringListToFill);
+ void fillInstalledSpellStringList(QStringList *stringListToFill);
void printInstalledList();
QString numericSequence(QString seq);
bool findSpellingDictionaries(QStringList& sl);
Modified: trunk/Scribus/scribus/ui/prefs_documentsetup.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21897&path=/trunk/Scribus/scribus/ui/prefs_documentsetup.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_documentsetup.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_documentsetup.cpp Fri Apr 14 21:13:37 2017
@@ -44,7 +44,7 @@
}
QStringList languageList;
- LanguageManager::instance()->fillInstalledHyphStringList(&languageList);
+ LanguageManager::instance()->fillInstalledStringList(&languageList);
languageList.sort();
languageComboBox->addItems( languageList );
Modified: trunk/Scribus/scribus/ui/prefs_userinterface.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21897&path=/trunk/Scribus/scribus/ui/prefs_userinterface.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_userinterface.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_userinterface.cpp Fri Apr 14 21:13:37 2017
@@ -28,7 +28,7 @@
QStringList languageList;
languageList <<"";
- LanguageManager::instance()->fillInstalledGUIStringList(&languageList, false);
+ LanguageManager::instance()->fillInstalledGUIStringList(&languageList);
languageComboBox->addItems( languageList );
// qt styles
Modified: trunk/Scribus/scribus/ui/propertiespalette_text.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21897&path=/trunk/Scribus/scribus/ui/propertiespalette_text.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_text.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_text.cpp Fri Apr 14 21:13:37 2017
@@ -395,7 +395,7 @@
if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
QStringList languageList;
- LanguageManager::instance()->fillInstalledStringList(&languageList, true);
+ LanguageManager::instance()->fillInstalledStringList(&languageList);
QString abrv = LanguageManager::instance()->getAbbrevFromLang(languageList.value(id),false);
Selection tempSelection(this, false);
tempSelection.addItem(m_item, true);
@@ -443,7 +443,7 @@
if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
QStringList lang;
- LanguageManager::instance()->fillInstalledStringList(&lang, true);
+ LanguageManager::instance()->fillInstalledStringList(&lang);
QString langName = LanguageManager::instance()->getLangFromAbbrev(w, true);
bool sigBlocked = langCombo->blockSignals(true);
@@ -709,7 +709,7 @@
lineSpacingModeCombo->setCurrentIndex(oldLineSpacingMode);
QStringList languageList;
- LanguageManager::instance()->fillInstalledStringList(&languageList, true);
+ LanguageManager::instance()->fillInstalledStringList(&languageList);
int oldLang = langCombo->currentIndex();
langCombo->clear();
langCombo->addItems(languageList);
Modified: trunk/Scribus/scribus/ui/smcstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21897&path=/trunk/Scribus/scribus/ui/smcstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smcstylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smcstylewidget.cpp Fri Apr 14 21:13:37 2017
@@ -69,7 +69,7 @@
void SMCStyleWidget::languageChange()
{
QStringList languageList;
- LanguageManager::instance()->fillInstalledStringList(&languageList, false);
+ LanguageManager::instance()->fillInstalledStringList(&languageList);
fillLangComboFromList(languageList);
if (fillColor_->count() > 0)
@@ -214,7 +214,7 @@
return;
QStringList languageList;
- LanguageManager::instance()->fillInstalledStringList(&languageList, false);
+ LanguageManager::instance()->fillInstalledStringList(&languageList);
fillLangComboFromList(languageList);
fillColorCombo(m_Doc->PageColors);
fontFace_->RebuildList(m_Doc);
More information about the scribus-commit
mailing list