diff --git a/CMakeLists.txt b/CMakeLists.txt
index 500fd191b..e2c967a58 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -384,6 +384,10 @@ set(APP_SOURCES
src/miscellaneous/iofactory.cpp
src/miscellaneous/autosaver.cpp
+ # EXCEPTIONS sources.
+ src/exceptions/applicationexception.cpp
+ src/exceptions/ioexception.cpp
+
# CORE sources.
src/core/messagesmodel.cpp
src/core/messagesproxymodel.cpp
diff --git a/resources/initial_feeds/feeds-en_GB.opml b/resources/initial_feeds/feeds-en_GB.opml
index 0bb617d5d..9f5596c71 100644
--- a/resources/initial_feeds/feeds-en_GB.opml
+++ b/resources/initial_feeds/feeds-en_GB.opml
@@ -2,17 +2,17 @@
RSS Guard
- Wed, 27 May 2015 16:15:55 GMT
+ Fri, 29 May 2015 06:54:31 GMT
-
-
-
-
-
+
+
+
+
+
-
-
+
+
diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG
index 4de4e2fbb..5ae621e0b 100644
--- a/resources/text/CHANGELOG
+++ b/resources/text/CHANGELOG
@@ -2,6 +2,9 @@
2.4.0
Added:
+- RSS Guard is now able to export/import feed/category icons to/from OPML 2.0 files.
+- Localizations now load their titles for localization list automatically.
+- All feeds are by default checked when exporting/importing them.
- Message previewer now displays MIME type of all podcasts too. This MIME type is also stored in DB.
- Ability to fetch only new icon for feed from its online source.
- Option to search highlighted text in web browser via Google, available from context menu. (issue #72)
@@ -9,6 +12,7 @@ Added:
Fixed:
+- Reworked DB initialization scripts.
- Titles and descriptions of feeds are now fetched correctly in feed add/edit dialog.
diff --git a/src/core/feedsimportexportmodel.cpp b/src/core/feedsimportexportmodel.cpp
index 5dc337ad7..79dbdcb1d 100644
--- a/src/core/feedsimportexportmodel.cpp
+++ b/src/core/feedsimportexportmodel.cpp
@@ -103,6 +103,7 @@ bool FeedsImportExportModel::exportToOMPL20(QByteArray &result) {
QDomElement outline_category = opml_document.createElement("outline");
outline_category.setAttribute("text", child_item->title());
outline_category.setAttribute("description", child_item->description());
+ outline_category.setAttribute("rssguard:icon", QString(qApp->icons()->toByteArray(child_item->icon())));
active_element.appendChild(outline_category);
items_to_process.push(child_item);
elements_to_use.push(outline_category);
@@ -117,6 +118,7 @@ bool FeedsImportExportModel::exportToOMPL20(QByteArray &result) {
outline_feed.setAttribute("description", child_feed->description());
outline_feed.setAttribute("encoding", child_feed->encoding());
outline_feed.setAttribute("title", child_feed->title());
+ outline_feed.setAttribute("rssguard:icon", QString(qApp->icons()->toByteArray(child_feed->icon())));
switch (child_feed->type()) {
case FeedsModelFeed::Rss0X:
@@ -188,6 +190,7 @@ bool FeedsImportExportModel::importAsOPML20(const QByteArray &data) {
QString feed_encoding = child_element.attribute("encoding", DEFAULT_FEED_ENCODING);
QString feed_type = child_element.attribute("version", DEFAULT_FEED_TYPE).toUpper();
QString feed_description = child_element.attribute("description");
+ QIcon feed_icon = qApp->icons()->fromByteArray(child_element.attribute("rssguard:icon").toLocal8Bit());
FeedsModelFeed *new_feed = new FeedsModelFeed(active_model_item);
new_feed->setTitle(feed_title);
@@ -195,7 +198,7 @@ bool FeedsImportExportModel::importAsOPML20(const QByteArray &data) {
new_feed->setEncoding(feed_encoding);
new_feed->setUrl(feed_url);
new_feed->setCreationDate(QDateTime::currentDateTime());
- new_feed->setIcon(qApp->icons()->fromTheme("folder-feed"));
+ new_feed->setIcon(feed_icon.isNull() ? qApp->icons()->fromTheme("folder-feed") : feed_icon);
new_feed->setAutoUpdateType(FeedsModelFeed::DefaultAutoUpdate);
if (feed_type == "RSS1") {
@@ -215,6 +218,7 @@ bool FeedsImportExportModel::importAsOPML20(const QByteArray &data) {
// Add category and continue.
QString category_title = child_element.attribute("text");
QString category_description = child_element.attribute("description");
+ QIcon category_icon = qApp->icons()->fromByteArray(child_element.attribute("rssguard:icon").toLocal8Bit());
if (category_title.isEmpty()) {
qWarning("Given OMPL file provided category without valid text attribute. Using fallback name.");
@@ -228,7 +232,7 @@ bool FeedsImportExportModel::importAsOPML20(const QByteArray &data) {
FeedsModelCategory *new_category = new FeedsModelCategory(active_model_item);
new_category->setTitle(category_title);
- new_category->setIcon(qApp->icons()->fromTheme("folder-category"));
+ new_category->setIcon(category_icon.isNull() ? qApp->icons()->fromTheme("folder-category") : category_icon);
new_category->setCreationDate(QDateTime::currentDateTime());
new_category->setDescription(category_description);
@@ -260,13 +264,17 @@ void FeedsImportExportModel::setMode(const FeedsImportExportModel::Mode &mode) {
void FeedsImportExportModel::checkAllItems() {
foreach (FeedsModelRootItem *root_child, m_rootItem->childItems()) {
- setData(indexForItem(root_child), Qt::Checked, Qt::CheckStateRole);
+ if (root_child->kind() != FeedsModelRootItem::RecycleBin) {
+ setData(indexForItem(root_child), Qt::Checked, Qt::CheckStateRole);
+ }
}
}
void FeedsImportExportModel::uncheckAllItems() {
foreach (FeedsModelRootItem *root_child, m_rootItem->childItems()) {
- setData(indexForItem(root_child), Qt::Unchecked, Qt::CheckStateRole);
+ if (root_child->kind() != FeedsModelRootItem::RecycleBin) {
+ setData(indexForItem(root_child), Qt::Unchecked, Qt::CheckStateRole);
+ }
}
}
@@ -373,6 +381,17 @@ QVariant FeedsImportExportModel::data(const QModelIndex &index, int role) const
return static_cast(Qt::Unchecked);
}
}
+ else if (role == Qt::DecorationRole) {
+ switch (item->kind()) {
+ case FeedsModelRootItem::Category:
+ case FeedsModelRootItem::RecycleBin:
+ case FeedsModelRootItem::Feed:
+ return item->icon();
+
+ default:
+ return QVariant();
+ }
+ }
else if (role == Qt::DisplayRole) {
switch (item->kind()) {
case FeedsModelRootItem::Category:
diff --git a/src/core/feedsmodel.cpp b/src/core/feedsmodel.cpp
index 2aaefaff4..1f4f69417 100755
--- a/src/core/feedsmodel.cpp
+++ b/src/core/feedsmodel.cpp
@@ -644,7 +644,7 @@ bool FeedsModel::mergeModel(FeedsImportExportModel *model, QString &output_messa
bool some_feed_category_error = false;
// We are definitely about to add some new items into the model.
- emit layoutAboutToBeChanged();
+ //emit layoutAboutToBeChanged();
// Iterate all new items we would like to merge into current model.
while (!new_parents.isEmpty()) {
@@ -698,7 +698,7 @@ bool FeedsModel::mergeModel(FeedsImportExportModel *model, QString &output_messa
}
// Changes are done now. Finalize the new model.
- emit layoutChanged();
+ //emit layoutChanged();
if (some_feed_category_error) {
output_message = tr("Import successfull, but some feeds/categories were not imported due to error.");
diff --git a/src/definitions/definitions.h.in b/src/definitions/definitions.h.in
index 731254888..f6d5b7096 100755
--- a/src/definitions/definitions.h.in
+++ b/src/definitions/definitions.h.in
@@ -83,6 +83,8 @@
#define DOWNLOADER_ICON_SIZE 48
#define GOOGLE_SEARCH_URL "https://www.google.com/search?q=%1&ie=utf-8&oe=utf-8"
+#define FEED_INITIAL_OPML_PATTERN "feeds-%1.opml"
+
#define FEED_REGEX_MATCHER "]+type=\\\"application/(atom|rss)\\+xml\\\"[^>]*>"
#define FEED_HREF_REGEX_MATCHER "href\\=\\\"[^\\\"]+\\\""
diff --git a/src/exceptions/applicationexception.cpp b/src/exceptions/applicationexception.cpp
new file mode 100644
index 000000000..86587cd38
--- /dev/null
+++ b/src/exceptions/applicationexception.cpp
@@ -0,0 +1,29 @@
+// This file is part of RSS Guard.
+//
+// Copyright (C) 2011-2015 by Martin Rotter
+//
+// RSS Guard is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// RSS Guard is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with RSS Guard. If not, see .
+
+#include "exceptions/applicationexception.h"
+
+
+ApplicationException::ApplicationException(const QString &message) : m_message(message) {
+}
+
+ApplicationException::~ApplicationException() {
+}
+
+QString ApplicationException::message() const {
+ return m_message;
+}
diff --git a/src/exceptions/applicationexception.h b/src/exceptions/applicationexception.h
new file mode 100644
index 000000000..85ddc9be1
--- /dev/null
+++ b/src/exceptions/applicationexception.h
@@ -0,0 +1,35 @@
+// This file is part of RSS Guard.
+//
+// Copyright (C) 2011-2015 by Martin Rotter
+//
+// RSS Guard is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// RSS Guard is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with RSS Guard. If not, see .
+
+#ifndef APPLICATIONEXCEPTION_H
+#define APPLICATIONEXCEPTION_H
+
+#include
+
+
+class ApplicationException {
+ public:
+ explicit ApplicationException(const QString &message = QString());
+ virtual ~ApplicationException();
+
+ QString message() const;
+
+ private:
+ QString m_message;
+};
+
+#endif // APPLICATIONEXCEPTION_H
diff --git a/src/exceptions/ioexception.cpp b/src/exceptions/ioexception.cpp
new file mode 100644
index 000000000..6276838da
--- /dev/null
+++ b/src/exceptions/ioexception.cpp
@@ -0,0 +1,25 @@
+// This file is part of RSS Guard.
+//
+// Copyright (C) 2011-2015 by Martin Rotter
+//
+// RSS Guard is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// RSS Guard is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with RSS Guard. If not, see .
+
+#include "exceptions/ioexception.h"
+
+
+IOException::IOException(const QString &message) : ApplicationException(message) {
+}
+
+IOException::~IOException() {
+}
diff --git a/src/exceptions/ioexception.h b/src/exceptions/ioexception.h
new file mode 100644
index 000000000..552aa8755
--- /dev/null
+++ b/src/exceptions/ioexception.h
@@ -0,0 +1,14 @@
+#ifndef IOEXCEPTION_H
+#define IOEXCEPTION_H
+
+#include "exceptions/applicationexception.h"
+
+
+class IOException : public ApplicationException
+{
+ public:
+ explicit IOException(const QString &message = QString());
+ virtual ~IOException();
+};
+
+#endif // IOEXCEPTION_H
diff --git a/src/gui/feedmessageviewer.cpp b/src/gui/feedmessageviewer.cpp
index e5bdbb573..fa270386b 100755
--- a/src/gui/feedmessageviewer.cpp
+++ b/src/gui/feedmessageviewer.cpp
@@ -25,6 +25,7 @@
#include "core/feeddownloader.h"
#include "core/feedsmodelfeed.h"
#include "core/feedsselection.h"
+#include "core/feedsimportexportmodel.h"
#include "network-web/webbrowser.h"
#include "gui/formmain.h"
#include "gui/messagesview.h"
@@ -34,6 +35,7 @@
#include "gui/messagebox.h"
#include "gui/messagestoolbar.h"
#include "gui/feedstoolbar.h"
+#include
#include
#include
@@ -134,6 +136,34 @@ void FeedMessageViewer::quit() {
}
}
+void FeedMessageViewer::loadInitialFeeds() {
+ QString target_opml_file = APP_INITIAL_FEEDS_PATH + QDir::separator() + FEED_INITIAL_OPML_PATTERN;
+ QString current_locale = qApp->localization()->loadedLanguage();
+ QString file_to_load;
+
+ if (QFile::exists(target_opml_file.arg(current_locale))) {
+ file_to_load = target_opml_file.arg(current_locale);
+ }
+ else if (QFile::exists(target_opml_file.arg(DEFAULT_LOCALE))) {
+ file_to_load = target_opml_file.arg(DEFAULT_LOCALE);
+ }
+
+ FeedsImportExportModel model;
+ QString output_msg;
+
+ try {
+ model.importAsOPML20(IOFactory::readTextFile(file_to_load));
+ model.checkAllItems();
+
+ if (m_feedsView->sourceModel()->mergeModel(&model, output_msg)) {
+ m_feedsView->expandAll();
+ }
+ }
+ catch (ApplicationException &ex) {
+ MessageBox::show(this, QMessageBox::Critical, tr("Error when loading initial feeds"), ex.message());
+ }
+}
+
void FeedMessageViewer::switchMessageSplitterOrientation() {
if (m_messageSplitter->orientation() == Qt::Vertical) {
m_messageSplitter->setOrientation(Qt::Horizontal);
diff --git a/src/gui/feedmessageviewer.h b/src/gui/feedmessageviewer.h
index 2edd83741..13b0d32cb 100644
--- a/src/gui/feedmessageviewer.h
+++ b/src/gui/feedmessageviewer.h
@@ -83,6 +83,9 @@ class FeedMessageViewer : public TabContent {
}
public slots:
+ void loadInitialFeeds();
+
+ // Switches orientation horizontal/vertical.
void switchMessageSplitterOrientation();
// Enables/disables main toolbars or list headers.
diff --git a/src/gui/formbackupdatabasesettings.cpp b/src/gui/formbackupdatabasesettings.cpp
index 0db4c1091..7aea42113 100644
--- a/src/gui/formbackupdatabasesettings.cpp
+++ b/src/gui/formbackupdatabasesettings.cpp
@@ -19,6 +19,7 @@
#include "miscellaneous/application.h"
#include "miscellaneous/iconfactory.h"
+#include "exceptions/applicationexception.h"
#include
#include
diff --git a/src/gui/formimportexport.cpp b/src/gui/formimportexport.cpp
index f5ef6e9d2..f86601f74 100644
--- a/src/gui/formimportexport.cpp
+++ b/src/gui/formimportexport.cpp
@@ -54,12 +54,13 @@ void FormImportExport::setMode(const FeedsImportExportModel::Mode &mode) {
switch (mode) {
case FeedsImportExportModel::Export: {
m_model->setRootItem(qApp->mainForm()->tabWidget()->feedMessageViewer()->feedsView()->sourceModel()->rootItem());
+ m_model->checkAllItems();
m_ui->m_treeFeeds->setModel(m_model);
m_ui->m_treeFeeds->expandAll();
- setWindowTitle(tr("Export feeds"));
- setWindowIcon(qApp->icons()->fromTheme("document-export"));
m_ui->m_groupFile->setTitle(tr("Destination file"));
m_ui->m_groupFeeds->setTitle(tr("Source feeds && categories"));
+ setWindowTitle(tr("Export feeds"));
+ setWindowIcon(qApp->icons()->fromTheme("document-export"));
break;
}
@@ -143,6 +144,7 @@ void FormImportExport::selectImportFile() {
m_ui->m_lblSelectFile->setStatus(WidgetWithStatus::Ok, QDir::toNativeSeparators(selected_file), tr("File is selected."));
parseImportFile(selected_file);
+ m_model->checkAllItems();
}
}
diff --git a/src/gui/formrestoredatabasesettings.cpp b/src/gui/formrestoredatabasesettings.cpp
index 90d9dac12..a1fc23bc7 100644
--- a/src/gui/formrestoredatabasesettings.cpp
+++ b/src/gui/formrestoredatabasesettings.cpp
@@ -20,6 +20,7 @@
#include "gui/messagebox.h"
#include "gui/formmain.h"
#include "miscellaneous/iconfactory.h"
+#include "exceptions/applicationexception.h"
#include "QFileDialog"
diff --git a/src/gui/formsettings.cpp b/src/gui/formsettings.cpp
index 12c013467..faff27d4f 100755
--- a/src/gui/formsettings.cpp
+++ b/src/gui/formsettings.cpp
@@ -75,8 +75,7 @@ FormSettings::FormSettings(QWidget *parent) : QDialog(parent), m_ui(new Ui::Form
<< /*: Language column of language list. */ tr("Language")
<< /*: Lang. code column of language list. */ tr("Code")
<< tr("Version")
- << tr("Author")
- << tr("Email"));
+ << tr("Author"));
m_ui->m_treeSkins->setColumnCount(4);
m_ui->m_treeSkins->setHeaderHidden(false);
@@ -468,7 +467,6 @@ void FormSettings::loadLanguage() {
item->setText(1, language.m_code);
item->setText(2, language.m_version);
item->setText(3, language.m_author);
- item->setText(4, language.m_email);
item->setIcon(0, qApp->icons()->fromTheme(QString(FLAG_ICON_SUBFOLDER) + QDir::separator() + language.m_code));
}
diff --git a/src/gui/formsettings.ui b/src/gui/formsettings.ui
index 63dbadd1c..cd532356d 100644
--- a/src/gui/formsettings.ui
+++ b/src/gui/formsettings.ui
@@ -88,7 +88,7 @@
-
- 5
+ 4
diff --git a/src/main.cpp b/src/main.cpp
index 3b22345aa..96e9a6308 100755
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -24,6 +24,7 @@
#include "gui/formmain.h"
#include "gui/feedmessageviewer.h"
#include "gui/feedsview.h"
+#include "gui/messagebox.h"
#include "network-web/silentnetworkaccessmanager.h"
// Needed for setting ini file format on Mac OS.
@@ -38,8 +39,6 @@
int main(int argc, char *argv[]) {
- //: Name of language, e.g. English.
- QObject::tr("LANG_NAME");
//: Abbreviation of language, e.g. en.
//: Use ISO 639-1 code here combined with ISO 3166-1 (alpha-2) code.
//: Examples: "cs_CZ", "en_GB", "en_US".
@@ -48,8 +47,6 @@ int main(int argc, char *argv[]) {
QObject::tr("LANG_VERSION");
//: Name of translator - optional.
QObject::tr("LANG_AUTHOR");
- //: Email of translator - optional.
- QObject::tr("LANG_EMAIL");
// Ensure that ini format is used as application settings storage on Mac OS.
#ifdef Q_OS_MAC
@@ -108,6 +105,18 @@ int main(int argc, char *argv[]) {
else {
qDebug("Showing the main window when the application is starting.");
main_window.show();
+
+ if (qApp->settings()->value(GROUP(General), SETTING(General::FirstRun)).toBool()) {
+ // This is the first time user runs this application.
+ qApp->settings()->setValue(GROUP(General), General::FirstRun, false);
+
+ if (MessageBox::show(&main_window, QMessageBox::Question, QObject::tr("Load initial feeds"),
+ QObject::tr("Your started %1 for the first time, now you can load initial set of feeds.").arg(APP_NAME),
+ QObject::tr("Do you want to load initial set of feeds?"),
+ QString(), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
+ qApp->mainForm()->tabWidget()->feedMessageViewer()->loadInitialFeeds();
+ }
+ }
}
// Display tray icon if it is enabled and available.
diff --git a/src/miscellaneous/application.cpp b/src/miscellaneous/application.cpp
index 564201488..62a6931cd 100755
--- a/src/miscellaneous/application.cpp
+++ b/src/miscellaneous/application.cpp
@@ -24,6 +24,7 @@
#include "gui/messagebox.h"
#include "gui/formmain.h"
#include "gui/statusbar.h"
+#include "exceptions/applicationexception.h"
#include
#include
@@ -242,13 +243,3 @@ void Application::restart() {
m_shouldRestart = true;
quit();
}
-
-ApplicationException::ApplicationException(const QString &message) : m_message(message) {
-}
-
-ApplicationException::~ApplicationException() {
-}
-
-QString ApplicationException::message() const {
- return m_message;
-}
diff --git a/src/miscellaneous/application.h b/src/miscellaneous/application.h
index c9c3a0019..a6b057572 100755
--- a/src/miscellaneous/application.h
+++ b/src/miscellaneous/application.h
@@ -45,17 +45,6 @@ class FormMain;
class IconFactory;
class QAction;
-class ApplicationException {
- public:
- explicit ApplicationException(const QString &message = QString());
- virtual ~ApplicationException();
-
- QString message() const;
-
- private:
- QString m_message;
-};
-
class Application : public QtSingleApplication {
Q_OBJECT
diff --git a/src/miscellaneous/iofactory.cpp b/src/miscellaneous/iofactory.cpp
index 9fdcfd0f8..1ebea3225 100755
--- a/src/miscellaneous/iofactory.cpp
+++ b/src/miscellaneous/iofactory.cpp
@@ -17,9 +17,12 @@
#include "miscellaneous/iofactory.h"
+#include
+
#include
#include
#include
+#include
IOFactory::IOFactory() {
@@ -33,6 +36,20 @@ QString IOFactory::getSystemFolder(SYSTEM_FOLDER_ENUM::StandardLocation location
#endif
}
+QByteArray IOFactory::readTextFile(const QString &file_path) {
+ QFile input_file(file_path);
+ QByteArray input_data;
+
+ if (input_file.open(QIODevice::Text | QIODevice::Unbuffered | QIODevice::ReadOnly)) {
+ input_data = input_file.readAll();
+ input_file.close();
+ return input_data;
+ }
+ else {
+ throw IOException(tr("Cannot open file '%s' for reading.").arg(QDir::toNativeSeparators(file_path)));
+ }
+}
+
bool IOFactory::copyFile(const QString &source, const QString &destination) {
if (QFile::exists(destination)) {
if (!QFile::remove(destination)) {
diff --git a/src/miscellaneous/iofactory.h b/src/miscellaneous/iofactory.h
index 9f972b70f..6cf54868b 100755
--- a/src/miscellaneous/iofactory.h
+++ b/src/miscellaneous/iofactory.h
@@ -19,6 +19,7 @@
#define IOFACTORY_H
#include
+#include
#if QT_VERSION >= 0x050000
#include
@@ -30,6 +31,8 @@
class IOFactory {
+ Q_DECLARE_TR_FUNCTIONS(IOFactory)
+
private:
IOFactory();
@@ -37,6 +40,8 @@ class IOFactory {
// Returns system-wide folder according to type.
static QString getSystemFolder(SYSTEM_FOLDER_ENUM::StandardLocation location);
+ static QByteArray readTextFile(const QString &file_path);
+
// Copies file, overwrites destination.
static bool copyFile(const QString &source, const QString &destination);
diff --git a/src/miscellaneous/localization.cpp b/src/miscellaneous/localization.cpp
index fc8d5f9c6..a8a9cede3 100755
--- a/src/miscellaneous/localization.cpp
+++ b/src/miscellaneous/localization.cpp
@@ -74,11 +74,11 @@ QList Localization::installedLanguages() {
QDir::Name)) {
if (translator.load(file.absoluteFilePath())) {
Language new_language;
- new_language.m_name = translator.translate("QObject", "LANG_NAME");
new_language.m_code = translator.translate("QObject", "LANG_ABBREV");
new_language.m_version = translator.translate("QObject", "LANG_VERSION");
new_language.m_author = translator.translate("QObject", "LANG_AUTHOR");
new_language.m_email = translator.translate("QObject", "LANG_EMAIL");
+ new_language.m_name = QLocale(new_language.m_code).nativeLanguageName();
languages << new_language;
}