Hello community,
here is the log from the commit of package parley for openSUSE:Factory checked in at 2016-08-31 00:09:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/parley (Old)
and /work/SRC/openSUSE:Factory/.parley.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "parley"
Changes:
--------
--- /work/SRC/openSUSE:Factory/parley/parley.changes 2016-07-24 19:49:37.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.parley.new/parley.changes 2016-08-31 00:09:18.000000000 +0200
@@ -1,0 +2,16 @@
+Fri Aug 12 10:31:47 UTC 2016 - tittiatcoke@gmail.com
+
+- Update to KDE Applications 16.08.0
+ * KDE Applications 16.08.0
+ * https://www.kde.org/announcements/announce-applications-16.08.0.php
+
+
+-------------------------------------------------------------------
+Mon Aug 8 15:53:30 UTC 2016 - tittiatcoke@gmail.com
+
+- Update to KDE Applications 16.07.90
+ * KDE Applications 16.07.90 (16.08-RC)
+ * https://www.kde.org/announcements/announce-applications-16.07.90.php
+
+
+-------------------------------------------------------------------
Old:
----
parley-16.04.3.tar.xz
New:
----
parley-16.08.0.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ parley.spec ++++++
--- /var/tmp/diff_new_pack.0jTIJ4/_old 2016-08-31 00:09:19.000000000 +0200
+++ /var/tmp/diff_new_pack.0jTIJ4/_new 2016-08-31 00:09:19.000000000 +0200
@@ -17,7 +17,7 @@
Name: parley
-Version: 16.04.3
+Version: 16.08.0
Release: 0
Summary: Vocabulary Trainer
License: GPL-2.0+
++++++ parley-16.04.3.tar.xz -> parley-16.08.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/CMakeLists.txt new/parley-16.08.0/CMakeLists.txt
--- old/parley-16.04.3/CMakeLists.txt 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/CMakeLists.txt 2016-07-28 15:11:23.000000000 +0200
@@ -13,6 +13,7 @@
#Allows QString concatenation to use a single memory allocation per source line.
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
+add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
set(REQUIRED_QT_VERSION "5.2")
find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED
@@ -22,7 +23,7 @@
Multimedia
)
-find_package(KF5 5.15 MODULE REQUIRED COMPONENTS
+find_package(KF5 5.22 MODULE REQUIRED COMPONENTS
DocTools #to produce the docbook
CoreAddons
Config
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/autotests/parleyunittestutilities.cpp new/parley-16.08.0/autotests/parleyunittestutilities.cpp
--- old/parley-16.04.3/autotests/parleyunittestutilities.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/autotests/parleyunittestutilities.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -51,7 +51,7 @@
doc->setAuthor( author );
doc->appendIdentifier( lang0 );
doc->setGenerator(generator);
- doc->saveAs(this->fileName(), KEduVocDocument::Kvtml);
+ doc->saveAs(QUrl::fromLocalFile(fileName()), KEduVocDocument::Kvtml);
delete doc;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/plugins/wiktionary/wiktionary_sound.py new/parley-16.08.0/plugins/wiktionary/wiktionary_sound.py
--- old/parley-16.04.3/plugins/wiktionary/wiktionary_sound.py 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/plugins/wiktionary/wiktionary_sound.py 2016-07-28 15:11:23.000000000 +0200
@@ -17,9 +17,19 @@
from os import path
import string
import Kross
+import urllib
T = Kross.module("kdetranslation")
+# fetch http_content
+def fetch_http_content(url, params, method):
+ params = urllib.urlencode(params)
+ if method=='POST':
+ f = urllib.urlopen(url, params)
+ else:
+ f = urllib.urlopen(url+'?'+params)
+ return (f.read(), f.code)
+
# Connected to the action menu
def fetchSound():
print "fetching sound"
@@ -95,8 +105,16 @@
filename = filesdir + wikiObject.name.encode('utf-8')
print filename
saveas = open(filename,'w')
- remote = wikiObject.download()
- saveas.write(remote.read())
+# remote = wikiObject.download()
+# workaround: because download method results with http response code 404
+ content, response_code = fetch_http_content(
+ wikiObject.imageinfo['url'],
+ {},
+ 'GET'
+ )
+ print 'HTTP Response code: ', response_code
+ if(response_code == 200):
+ saveas.write(content)
saveas.close()
return filename
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/collection/collection.cpp new/parley-16.08.0/src/collection/collection.cpp
--- old/parley-16.04.3/src/collection/collection.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/collection/collection.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -15,59 +15,19 @@
#include "collection.h"
-#include <QTimer>
-#include <QLocale>
-
-// KDE
-#include <KEMailSettings>
-#include
-//#include <KLocale>
-
// KEduVocDocument library
#include
-#include
-#include
-#include
-#include
// Parley
-#include "../config-parley.h"
#include "../utils.h"
-#include "prefs.h"
#include "entryfilter.h"
// ----------------------------------------------------------------
-
-void fetchGrammar(KEduVocDocument* doc, int languageIndex)
-{
- QString locale = doc->identifier(languageIndex).locale();
-
- QUrl location(QStringLiteral("http://edu.kde.org/parley/locale/") + locale.split('_').at(0).toLower() + QStringLiteral(".kvtml"));
-
- KEduVocDocument grammarDoc;
- if (grammarDoc.open(location) == KEduVocDocument::NoError) {
- doc->identifier(languageIndex).setArticle(grammarDoc.identifier(0).article());
- doc->identifier(languageIndex).setPersonalPronouns(grammarDoc.identifier(0).personalPronouns());
- // @todo m_doc->identifier(index).setDeclension(grammarDoc.identifier(0).declension());
- doc->identifier(languageIndex).setTenseList(grammarDoc.identifier(0).tenseList());
- } else {
- qDebug() << "Download of " << location.url() << " failed.";
- }
-}
-
-Collection::Collection(KEduVocDocument *doc, QObject* parent)
- : QObject(parent)
- , m_doc(doc)
- , m_backupTimer(0)
-{
-}
-
Collection::Collection(QUrl *url, QObject* parent)
: QObject(parent)
, m_doc(new KEduVocDocument(this))
- , m_backupTimer(0)
{
// We ignore file locks here because we open the file for readonly
// purposes only.
@@ -76,52 +36,13 @@
Collection::~Collection()
{
- close();
-
- // NOTE: No saving here because at this point the Collection class is a
- // read-only wrapper around KEduVocDocument.
- if (m_doc) {
- emit documentChanged(0);
- m_doc->deleteLater();
- m_doc = 0;
- }
-
- delete m_backupTimer;
}
-
KEduVocDocument *Collection::eduVocDocument()
{
- // If there is no present vocabulary document, create an empty one.
- if (!m_doc) {
- m_doc = new KEduVocDocument();
- }
-
return m_doc;
}
-void Collection::setTitle(const QString& title)
-{
- m_doc->setTitle(title);
-}
-
-
-
-void Collection::enableAutoBackup(bool enable)
-{
- if (!enable) {
- if (m_backupTimer) {
- m_backupTimer->stop();
- }
- } else {
- if (!m_backupTimer) {
- m_backupTimer = new QTimer(this);
- connect(m_backupTimer, SIGNAL(timeout()), this, SLOT(save()));
- }
- m_backupTimer->start(Prefs::backupTime() * 60 * 1000);
- }
-}
-
void Collection::numDueWords(WordCount &wc)
{
// Get the entries from the collection. Cache them for future use.
@@ -131,7 +52,6 @@
}
// Count the number of words due for each grade level.
- // TODO: Also take into account pregrades.
foreach (const TestEntry *entry, m_allTestEntries) {
int languageTo = entry->languageTo();
KEduVocExpression *exp = entry->entry();
@@ -155,81 +75,3 @@
//kDebug() << m_doc->title() << wc.totalWords << "entries";
}
-
-// Slots
-
-
-void Collection::close()
-{
- enableAutoBackup(false);
- m_doc->close();
-}
-
-
-// ----------------------------------------------------------------
-// private functions
-
-
-void Collection::setDefaultDocumentProperties(KEduVocDocument *doc)
-{
- KEMailSettings emailSettings;
- emailSettings.setProfile(emailSettings.defaultProfileName());
- doc->setAuthor(emailSettings.getSetting(KEMailSettings::RealName));
- doc->setAuthorContact(emailSettings.getSetting(KEMailSettings::EmailAddress));
-
- doc->setLicense(i18n("Public Domain"));
- doc->setCategory(i18n("Languages"));
-
- QString locale = QLocale().name();
-
- doc->appendIdentifier();
- doc->appendIdentifier();
- doc->identifier(0).setName(QLocale(locale).nativeLanguageName());
- doc->identifier(0).setLocale(locale);
- doc->identifier(1).setName(i18n("A Second Language"));
- doc->identifier(1).setLocale(locale);
-
- KEduVocLesson* lesson = new KEduVocLesson(i18n("Lesson 1"), doc->lesson());
- doc->lesson()->appendChildContainer(lesson);
-
- // add some entries
- for (int i = 0; i < 15 ; i++) {
- lesson->appendEntry(new KEduVocExpression());
- }
-
- doc->setModified(false);
-}
-
-void Collection::initializeDefaultGrammar(KEduVocDocument *doc)
-{
- KEduVocWordType *root = doc->wordTypeContainer();
- KEduVocWordType *noun = new KEduVocWordType(i18n("Noun"), root);
- noun->setWordType(KEduVocWordFlag::Noun);
- root->appendChildContainer(noun);
-
- KEduVocWordType *nounChild = new KEduVocWordType(i18n("Masculine"), noun);
- nounChild->setWordType(KEduVocWordFlag::Noun | KEduVocWordFlag::Masculine);
- noun->appendChildContainer(nounChild);
- nounChild = new KEduVocWordType(i18n("Feminine"), noun);
- nounChild->setWordType(KEduVocWordFlag::Noun | KEduVocWordFlag::Feminine);
- noun->appendChildContainer(nounChild);
- nounChild = new KEduVocWordType(i18n("Neuter"), noun);
- nounChild->setWordType(KEduVocWordFlag::Noun | KEduVocWordFlag::Neuter);
- noun->appendChildContainer(nounChild);
-
- KEduVocWordType *verb = new KEduVocWordType(i18n("Verb"), root);
- verb->setWordType(KEduVocWordFlag::Verb);
- root->appendChildContainer(verb);
-
- KEduVocWordType *adjective = new KEduVocWordType(i18n("Adjective"), root);
- adjective->setWordType(KEduVocWordFlag::Adjective);
- root->appendChildContainer(adjective);
-
- KEduVocWordType *adverb = new KEduVocWordType(i18n("Adverb"), root);
- adverb->setWordType(KEduVocWordFlag::Adverb);
- root->appendChildContainer(adverb);
-
- KEduVocWordType *conjunction = new KEduVocWordType(i18n("Conjunction"), root);
- conjunction->setWordType(KEduVocWordFlag::Conjunction);
- root->appendChildContainer(conjunction);
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/collection/collection.h new/parley-16.08.0/src/collection/collection.h
--- old/parley-16.04.3/src/collection/collection.h 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/collection/collection.h 2016-07-28 15:11:23.000000000 +0200
@@ -27,7 +27,6 @@
#include "testentry.h"
-class QTimer;
class WordCount;
@@ -36,43 +35,15 @@
Q_OBJECT
public:
- Collection(KEduVocDocument *doc, QObject* parent = 0);
Collection(QUrl *url, QObject* parent = 0);
~Collection();
-
KEduVocDocument *eduVocDocument();
-
- void setTitle(const QString& title);
-
void numDueWords(WordCount &wc);
-
- /** Enable/disable the timed auto backup
- */
- void enableAutoBackup(bool enable);
-
-public Q_SLOTS:
-
- /** close the document*/
- void close();
-
-Q_SIGNALS:
- /** Emitted when the document pointer is changed.
- @todo Stop using documentChanged(0) as a replacement for destoyed in editor classes.**/
- void documentChanged(KEduVocDocument *newDocument);
- void languagesChanged();
- void statesNeedSaving();
-
-private:
- void initializeDefaultGrammar(KEduVocDocument *doc);
- void setDefaultDocumentProperties(KEduVocDocument *doc);
-
private:
// The contents of the document
KEduVocDocument *m_doc;
-
- QTimer *m_backupTimer; // Timer for next autosave
QList m_allTestEntries;
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/collection/entryfilter.cpp new/parley-16.08.0/src/collection/entryfilter.cpp
--- old/parley-16.04.3/src/collection/entryfilter.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/collection/entryfilter.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -335,9 +335,9 @@
{
foreach(const QString & tense, translation->conjugationTenses()) {
if (m_tenses.contains(tense)) {
- QList<KEduVocWordFlags> pronouns = translation->conjugation(tense).keys();
+ QList<KEduVocWordFlags> pronouns = translation->getConjugation(tense).keys();
foreach(const KEduVocWordFlags & pronoun, pronouns) {
- KEduVocText grade = translation->conjugation(tense).conjugation(pronoun);
+ KEduVocText grade = translation->getConjugation(tense).conjugation(pronoun);
if (!isBlocked(&(grade))) {
// just need to find any form that is not blocked for generating test entries
// exact filtering is done later in conjugationTestEntries
@@ -523,7 +523,7 @@
QSet<QString> practice_tenses = QSet<QString>::fromList(m_tenses);
QSet<QString> existing_tenses;
foreach(const QString & tense, translation->conjugationTenses()) {
- if (!translation->conjugation(tense).isEmpty()) {
+ if (!translation->getConjugation(tense).isEmpty()) {
existing_tenses << tense;
}
}
@@ -563,7 +563,7 @@
if (!m_tenses.contains(tense)) {
continue;
}
- KEduVocConjugation& conjugation = entry->translation(m_toTranslation)->conjugation(tense);
+ KEduVocConjugation conjugation = entry->translation(m_toTranslation)->getConjugation(tense);
if (conjugation.isEmpty()) {
continue;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/dashboard/barwidget.cpp new/parley-16.08.0/src/dashboard/barwidget.cpp
--- old/parley-16.04.3/src/dashboard/barwidget.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/dashboard/barwidget.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -70,7 +70,7 @@
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing, true);
const int legendWidth = COLLWIDTH - 10;
- const int legendHeight = 20;
+ const int legendHeight = 45;
const int legendOffsetY = 0;
const int legendOffsetX = 0;
//const int alphaValueIncrement = 35;
@@ -133,10 +133,10 @@
//QPen pen(QColor(0, 0, 0));
painter.setPen(pen);
if (m_percentageCompleted < 100) {
- painter.drawText(0, 0, legendWidth, 20, Qt::AlignCenter,
+ painter.drawText(0, 0, legendWidth, legendHeight, Qt::AlignCenter | Qt::TextWordWrap,
i18np("%1 word due", "%1 words due", m_totalDueWords));
}
else {
- painter.drawText(0, 0, legendWidth, 20, Qt::AlignCenter, i18n("Fully learned"));
+ painter.drawText(0, 0, legendWidth, legendHeight, Qt::AlignCenter | Qt::TextWordWrap, i18n("Fully learned"));
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/dashboard/collectionwidget.cpp new/parley-16.08.0/src/dashboard/collectionwidget.cpp
--- old/parley-16.04.3/src/dashboard/collectionwidget.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/dashboard/collectionwidget.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -36,10 +36,10 @@
// Size constants for the collection widgets
-int COLLWIDTH = 140; // Width in pixels of a collection widget
+int COLLWIDTH = 155; // Width in pixels of a collection widget
//int COLLHEIGHT1 = 250; // Height in pixels of a collection widget not yet fully learned
-int COLLHEIGHT1 = 150; // Height in pixels of a collection widget not yet fully learned
-int COLLHEIGHT2 = 100; // Height in pixels of a collection widget fully learned
+int COLLHEIGHT1 = 175; // Height in pixels of a collection widget not yet fully learned
+int COLLHEIGHT2 = 125; // Height in pixels of a collection widget fully learned
// ================================================================
@@ -81,20 +81,6 @@
painter.drawText(2, 1, height() - 2, height() - 1, Qt::AlignCenter, QStringLiteral("x"));
}
-
-// ----------------------------------------------------------------
-
-
-static int randInt(int low, int high)
-{
- // Random number between low and high
- return qrand() % ((high + 1) - low) + low;
-}
-
-
-// ----------------------------------------------------------------
-
-
CollectionWidget::CollectionWidget(Collection *collection, WordCount *dueWords, QWidget *parent)
: QWidget(parent)
, m_collection(collection)
@@ -178,10 +164,13 @@
}
m_barWidget = new BarWidget(dueWords, this);
- m_barWidget->setFixedSize(COLLWIDTH - 10, 20);
+ m_barWidget->setFixedSize(COLLWIDTH - 10, 45);
mainLayout->addWidget(m_barWidget);
m_practiceButton = new QPushButton(this);
- m_practiceButton->setStyleSheet(QStringLiteral("QPushButton {border: none; margin: 0px; padding: 0px;}"));
+ QString buttonStyleSheet = "QPushButton { border: none; margin: 0px; padding: 0px; color: " +
+ palette.color(QPalette::Active, QPalette::ButtonText).name()+ "; background-color: " +
+ palette.color(QPalette::Active, QPalette::Button).name() + "; border-radius: 3px;}";
+ m_practiceButton->setStyleSheet(buttonStyleSheet);
// buttonLayout is the horizontal layout for the bottom line in the
// collection widget: delete button, practice button, etc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/dashboard/dashboard.cpp new/parley-16.08.0/src/dashboard/dashboard.cpp
--- old/parley-16.04.3/src/dashboard/dashboard.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/dashboard/dashboard.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -38,14 +38,6 @@
#include "gradereferencewidget.h"
-// ----------------------------------------------------------------
-
-static int randInt(int low, int high)
-{
- // Random number between low and high
- return qrand() % ((high + 1) - low) + low;
-}
-
// ================================================================
// class Dashboard
@@ -213,7 +205,6 @@
QUrl url(QUrl::fromLocalFile(urlString));
Collection *collection = new Collection(&url, this);
- collection->close(); // We just want to look at it, not own it, so release the lock.
WordCount dueWords;
int percentageCompleted = dueWords.percentageCompleted();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/editor/audiowidget.cpp new/parley-16.08.0/src/editor/audiowidget.cpp
--- old/parley-16.04.3/src/editor/audiowidget.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/editor/audiowidget.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -48,7 +48,7 @@
if (m_entry) {
recordButton->setEnabled(true);
audioUrlRequester->setEnabled(true);
- audioUrlRequester->setUrl(m_entry->translation(m_currentTranslation)->soundUrl().toLocalFile());
+ audioUrlRequester->setUrl(m_entry->translation(m_currentTranslation)->soundUrl());
} else {
recordButton->setEnabled(false);
audioUrlRequester->setEnabled(false);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/editor/conjugationwidget.cpp new/parley-16.08.0/src/editor/conjugationwidget.cpp
--- old/parley-16.04.3/src/editor/conjugationwidget.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/editor/conjugationwidget.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -78,7 +78,10 @@
{
int valueIndex = m_conjugationLineEdits.values().indexOf(qobject_cast(sender()));
int key = m_conjugationLineEdits.keys().value(valueIndex);
- m_entry->translation(m_identifier)->conjugation(tenseComboBox->currentText()).setConjugation(text, (KEduVocWordFlag::Flags)key);
+ KEduVocTranslation *translation = m_entry->translation(m_identifier);
+ KEduVocConjugation conjugation = translation->getConjugation(tenseComboBox->currentText());
+ conjugation.setConjugation(text, (KEduVocWordFlag::Flags)key);
+ translation->setConjugation(tenseComboBox->currentText(), conjugation);
}
@@ -92,7 +95,7 @@
void ConjugationWidget::updateEntries()
{
m_lastTenseSelection = tenseComboBox->currentText();
- KEduVocConjugation& conjugation = m_entry->translation(m_identifier)->conjugation(m_lastTenseSelection);
+ KEduVocConjugation conjugation = m_entry->translation(m_identifier)->getConjugation(m_lastTenseSelection);
foreach(KEduVocWordFlags flags, m_conjugationLineEdits.keys()) {
QString text;
if (conjugation.keys().contains(flags)) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/editor/imagechooserwidget.cpp new/parley-16.08.0/src/editor/imagechooserwidget.cpp
--- old/parley-16.04.3/src/editor/imagechooserwidget.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/editor/imagechooserwidget.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -42,7 +42,7 @@
if (m_entry) {
setEnabled(true);
- imageUrlRequester->setUrl(m_entry->translation(m_currentTranslation)->imageUrl().toLocalFile());
+ imageUrlRequester->setUrl(m_entry->translation(m_currentTranslation)->imageUrl());
// slotImageChanged( m_entry->translation(m_currentTranslation)->imageUrl().toLocalFile() );
} else {
setEnabled(false);
@@ -52,10 +52,11 @@
}
}
-void ImageChooserWidget::slotImageChanged(const QString & url)
+void ImageChooserWidget::slotImageChanged(const QString & urlStr)
{
- if (!url.isEmpty()) {
- QPixmap pixmap(url);
+ QUrl url = QUrl::fromUserInput(urlStr);
+ if (!url.isEmpty() && url.isLocalFile()) {
+ QPixmap pixmap(url.toLocalFile());
imageWidget->setPixmap(pixmap);
} else {
// imageLabel->setText(i18nc("@label image preview is empty", "No Image"));
@@ -63,7 +64,7 @@
}
if (m_entry) {
- m_entry->translation(m_currentTranslation)->setImageUrl( QUrl::fromLocalFile(url));
+ m_entry->translation(m_currentTranslation)->setImageUrl(url);
foreach(int j, m_entry->translationIndices()) {
if (m_entry->translation(j)->imageUrl().isEmpty()) {
m_entry->translation(j)->setImageUrl(imageUrlRequester->url());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/editor/multiplechoicewidget.cpp new/parley-16.08.0/src/editor/multiplechoicewidget.cpp
--- old/parley-16.04.3/src/editor/multiplechoicewidget.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/editor/multiplechoicewidget.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -28,14 +28,16 @@
using namespace Editor;
-MultipleChoiceWidget::MultipleChoiceWidget(QWidget *parent) : QWidget(parent)
+MultipleChoiceWidget::MultipleChoiceWidget(QWidget *parent)
+ : QWidget(parent)
+ , m_translation(Q_NULLPTR)
+ , m_choicesModel(new QStringListModel(this))
{
setupUi(this);
connect(addChoiceButton, &QPushButton::clicked, this, &MultipleChoiceWidget::slotAddChoiceButton);
connect(removeChoiceButton, &QPushButton::clicked, this, &MultipleChoiceWidget::slotRemoveChoiceButton);
- m_choicesModel = new QStringListModel(this);
multipleChoiceListView->setModel(m_choicesModel);
connect(m_choicesModel, &QStringListModel::dataChanged, this, &MultipleChoiceWidget::slotDataChanged);
@@ -47,16 +49,20 @@
}
-void MultipleChoiceWidget::slotDataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight)
+void MultipleChoiceWidget::slotDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
{
Q_UNUSED(topLeft)
Q_UNUSED(bottomRight)
- m_translation->multipleChoice() = m_choicesModel->stringList();
- removeChoiceButton->setEnabled(m_translation && m_translation->multipleChoice().count() > 0);
+ if (m_translation) {
+ m_translation->setMultipleChoice(m_choicesModel->stringList());
+ removeChoiceButton->setEnabled(m_translation->getMultipleChoice().count() > 0);
+ } else {
+ removeChoiceButton->setEnabled(false);
+ }
}
-void MultipleChoiceWidget::setTranslation(KEduVocExpression * entry, int translation)
+void MultipleChoiceWidget::setTranslation(KEduVocExpression *entry, int translation)
{
if (entry) {
m_translation = entry->translation(translation);
@@ -66,12 +72,12 @@
if (m_translation) {
setEnabled(true);
- m_choicesModel->setStringList(m_translation->multipleChoice());
- removeChoiceButton->setEnabled(m_translation->multipleChoice().count() > 0);
+ m_choicesModel->setStringList(m_translation->getMultipleChoice());
+ removeChoiceButton->setEnabled(m_translation->getMultipleChoice().count() > 0);
} else {
setEnabled(false);
}
- removeChoiceButton->setEnabled(m_translation && m_translation->multipleChoice().count() > 0);
+ removeChoiceButton->setEnabled(m_translation && m_translation->getMultipleChoice().count() > 0);
}
@@ -94,12 +100,16 @@
} else {
m_choicesModel->removeRows(m_choicesModel->rowCount(QModelIndex()) - 1, 1, QModelIndex());
}
- m_translation->multipleChoice() = m_choicesModel->stringList();
- removeChoiceButton->setEnabled(m_translation && m_translation->multipleChoice().count() > 0);
+ if (m_translation) {
+ m_translation->setMultipleChoice(m_choicesModel->stringList());
+ removeChoiceButton->setEnabled(m_translation->getMultipleChoice().count() > 0);
+ } else {
+ removeChoiceButton->setEnabled(false);
+ }
}
-bool MultipleChoiceWidget::eventFilter(QObject * obj, QEvent * event)
+bool MultipleChoiceWidget::eventFilter(QObject *obj, QEvent *event)
{
if (obj == multipleChoiceListView) {
if (event->type() == QEvent::DragEnter) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/editor/multiplechoicewidget.h new/parley-16.08.0/src/editor/multiplechoicewidget.h
--- old/parley-16.04.3/src/editor/multiplechoicewidget.h 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/editor/multiplechoicewidget.h 2016-07-28 15:11:23.000000000 +0200
@@ -45,19 +45,19 @@
explicit MultipleChoiceWidget(QWidget *parent = 0);
public slots:
- void setTranslation(KEduVocExpression* entry, int translation);
+ void setTranslation(KEduVocExpression *entry, int translation);
protected:
bool eventFilter(QObject *obj, QEvent *event);
private slots:
- void slotDataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight);
+ void slotDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
void slotAddChoiceButton();
void slotRemoveChoiceButton();
private:
- KEduVocTranslation* m_translation;
- QStringListModel * m_choicesModel;
+ KEduVocTranslation *m_translation;
+ QStringListModel *m_choicesModel;
};
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/org.kde.parley.desktop new/parley-16.08.0/src/org.kde.parley.desktop
--- old/parley-16.04.3/src/org.kde.parley.desktop 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/org.kde.parley.desktop 2016-07-28 15:11:23.000000000 +0200
@@ -68,6 +68,7 @@
Comment[el]=Πρόγραμμα που θα σας βοηθήσει στην απομνημόνευση πραγμάτων.
Comment[en_GB]=A program to help you memorise things.
Comment[es]=Un programa para ayudarle a memorizar cosas.
+Comment[et]=Rakendus meeldejätmise hõlbustamiseks ja harjutamiseks.
Comment[fi]=Ohjelma asioiden ulkoa opettelemiseen.
Comment[gl]=Un programa para axudalo a memorizar cousas.
Comment[it]=Un programma per aiutarti a memorizzare le cose.
@@ -80,7 +81,6 @@
Comment[sv]=Ett program som hjälper dig memorera saker.
Comment[uk]=Програма, яка допоможе вам запам’ятовувати знання.
Comment[x-test]=xxA program to help you memorize things.xx
-Comment[zh_TW]=訓練記憶力的程式。
X-DBUS-ServiceName=org.kde.parley
GenericName=Vocabulary Trainer
GenericName[af]=Woordeskat-afrigter
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/parleydocument.cpp new/parley-16.08.0/src/parleydocument.cpp
--- old/parley-16.04.3/src/parleydocument.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/parleydocument.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -562,7 +562,7 @@
QMimeType mimeType = db.mimeTypeForFile(file);
qDebug() << "KNS2 file of mime type:" << db.mimeTypeForFile(file).name();
if (mimeType.inherits(QStringLiteral("application/x-kvtml"))) {
- ParleyMainWindow::instance()->addRecentFile(file, QString()); ///@todo: title!
+ ParleyMainWindow::instance()->addRecentFile(QUrl::fromLocalFile(file), QString()); ///@todo: title!
fileName = file;
}
}
@@ -574,7 +574,7 @@
if (numberInstalled > 1) {
openGHNS();
} else if (numberInstalled == 1) {
- if (open(QUrl::fromUserInput(fileName)))
+ if (open(QUrl::fromLocalFile(fileName)))
m_parleyApp->showPracticeConfiguration();
else
KMessageBox::error(m_parleyApp, i18n("Could not open vocabulary collection \"%1\"", entries.first().name()));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/practice/configure/blockoptions.cpp new/parley-16.08.0/src/practice/configure/blockoptions.cpp
--- old/parley-16.04.3/src/practice/configure/blockoptions.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/practice/configure/blockoptions.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -206,6 +206,9 @@
block5->setEnabled(state);
block6->setEnabled(state);
block7->setEnabled(state);
+ if (state) {
+ checkValidity();
+ }
}
void BlockOptions::slotExpireToggled(bool state)
@@ -217,6 +220,9 @@
expire5->setEnabled(state);
expire6->setEnabled(state);
expire7->setEnabled(state);
+ if (state) {
+ checkValidity();
+ }
}
void BlockOptions::slotComboBoxActivated(int)
@@ -229,16 +235,12 @@
void BlockOptions::checkValidity()
{
QString message;
- bool found = false;
- for (int i = 1; i <= 6; i++) {
- if (kcfg_Block->isChecked()) {
- /*if (Prefs::blockItem(i-1) != 0 &&
- Prefs::blockItem(i) != 0 &&
- Prefs::blockItem(i-1) >= Prefs::blockItem(i))*/
+ if (kcfg_Block->isChecked()) {
+ bool found = false;
+ for (int i = 1; i <= 6; i++) {
if (date_itemlist[m_blockComboList[i - 1]->currentIndex()].num != 0 &&
date_itemlist[m_blockComboList[i]->currentIndex()].num != 0 &&
date_itemlist[m_blockComboList[i - 1]->currentIndex()].num >= date_itemlist[m_blockComboList[i]->currentIndex()].num) {
- QString format;
if (!found)
message.append(i18n("Illogical blocking times.\n"));
found = true;
@@ -247,14 +249,13 @@
}
}
- for (int i = 1; i <= 6; i++) {
- found = false;
- if (kcfg_Expire->isChecked()) {
+ if (kcfg_Expire->isChecked()) {
+ bool found = false;
+ for (int i = 1; i <= 6; i++) {
if (date_itemlist[m_expireComboList[i - 1]->currentIndex()].num != 0 &&
date_itemlist[m_expireComboList[i]->currentIndex()].num != 0 &&
date_itemlist[m_expireComboList[i - 1]->currentIndex()].num >=
date_itemlist[m_expireComboList[i]->currentIndex()].num) {
- QString format;
if (!found)
message.append(i18n("\nIllogical expiration times.\n"));
found = true;
@@ -263,17 +264,14 @@
}
}
- if (message.length() == 0) {
- found = false;
+ if ((message.length() == 0) && kcfg_Block->isChecked() && kcfg_Expire->isChecked()) {
+ bool found = false;
for (int i = 0; i <= 6; i++) {
- if (kcfg_Block->isChecked() &&
- kcfg_Expire->isChecked() &&
- m_expireComboList[i]->currentIndex() >= 0 &&
+ if (m_expireComboList[i]->currentIndex() >= 0 &&
m_blockComboList[i]->currentIndex() >= 0 &&
date_itemlist[m_expireComboList[i]->currentIndex()].num != 0 &&
date_itemlist[m_blockComboList[i]->currentIndex()].num != 0 &&
date_itemlist[m_blockComboList[i]->currentIndex()].num >= date_itemlist[m_expireComboList[i]->currentIndex()].num) {
- QString format;
if (!found)
message.append(i18n("\nIllogical blocking vs. expiration times.\n"));
found = true;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/practice/configure/generalpracticeoptions.cpp new/parley-16.08.0/src/practice/configure/generalpracticeoptions.cpp
--- old/parley-16.04.3/src/practice/configure/generalpracticeoptions.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/practice/configure/generalpracticeoptions.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -34,7 +34,4 @@
setupUi(this);
//connect(kcfg_ShowSolutionAfterAnswer, SIGNAL(toggled(bool)), kcfg_ShowSolutionAfterAnswerTime, SLOT(setEnabled(bool)));
-
- I18N_NOOP("Limit the number of words in the initial phase");
- I18N_NOOP("Max number of words in the initial phase");
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/practice/conjugationbackendmode.cpp new/parley-16.08.0/src/practice/conjugationbackendmode.cpp
--- old/parley-16.04.3/src/practice/conjugationbackendmode.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/practice/conjugationbackendmode.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -46,7 +46,7 @@
}
data.tense = m_currentTense;
- m_conjugation = m_current->entry()->translation(m_current->languageTo())->conjugation(m_currentTense);
+ m_conjugation = m_current->entry()->translation(m_current->languageTo())->getConjugation(m_currentTense);
m_pronounFlags = current->conjugationPronouns();
data.questionInfinitive = m_current->entry()->translation(m_current->languageFrom())->text();
@@ -119,7 +119,7 @@
{
Q_ASSERT(m_current != 0);
KEduVocTranslation* trans = m_current->entry()->translation(m_current->languageTo());
- KEduVocConjugation& conj = trans->conjugation(m_current->conjugationTense());
+ KEduVocConjugation conj = trans->getConjugation(m_current->conjugationTense());
QList<KEduVocWordFlags> keys = conj.keys();
grade_t min_grade = KV_MAX_GRADE;
@@ -134,7 +134,7 @@
{
Q_ASSERT(m_current != 0);
KEduVocTranslation* trans = m_current->entry()->translation(m_current->languageTo());
- KEduVocConjugation& conj = trans->conjugation(m_current->conjugationTense());
+ KEduVocConjugation conj = trans->getConjugation(m_current->conjugationTense());
QList<KEduVocWordFlags> keys = conj.keys();
grade_t min_grade = KV_MAX_GRADE;
@@ -150,14 +150,18 @@
qDebug() << "Grading conjugations";
foreach(const KEduVocWordFlags & key, m_pronounFlags) {
- KEduVocText& text = m_current->entry()->translation(m_current->languageTo())->
- conjugation(m_currentTense).conjugation(key);
+ KEduVocTranslation *translation = m_current->entry()->translation(m_current->languageTo());
+ if (translation) {
+ KEduVocConjugation conjugationToUpdate = translation->getConjugation(m_currentTense);
+ conjugationToUpdate.conjugation(key).incPracticeCount();
+ conjugationToUpdate.conjugation(key).setPracticeDate(QDateTime::currentDateTime());
+
+ updateGrade(conjugationToUpdate.conjugation(key),
+ m_frontend->resultState() == AbstractFrontend::AnswerCorrect,
+ m_current->statisticBadCount() == 0);
- text.incPracticeCount();
- text.setPracticeDate(QDateTime::currentDateTime());
-
- updateGrade(text, m_frontend->resultState() == AbstractFrontend::AnswerCorrect,
- m_current->statisticBadCount() == 0);
+ translation->setConjugation(m_currentTense, conjugationToUpdate);
+ }
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/practice/guifrontend.cpp new/parley-16.08.0/src/practice/guifrontend.cpp
--- old/parley-16.04.3/src/practice/guifrontend.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/practice/guifrontend.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -32,20 +32,25 @@
using namespace Practice;
-GuiFrontend::GuiFrontend(QWidget* parent)
- : AbstractFrontend(parent), m_modeWidget(0), m_lastImage(QStringLiteral("invalid")), m_currentBox(0), m_newBoxIfCorrect(0), m_newBoxIfWrong(0)
+GuiFrontend::GuiFrontend(QWidget *parent)
+ : AbstractFrontend(parent)
+ , m_widget(new ImageWidget())
+ , m_ui(new Ui::PracticeMainWindow())
+ , m_modeWidget(nullptr)
+ , m_resultState(AbstractFrontend::AnswerWrong)
+ , m_feedbackState(AbstractFrontend::AnswerWrong)
+ , m_currentBox(0)
+ , m_newBoxIfCorrect(0)
+ , m_newBoxIfWrong(0)
+ , m_themedBackgroundRenderer(new ThemedBackgroundRenderer(this, QStringLiteral("practicethemecache.bin")))
{
- m_widget = new ImageWidget();
m_widget->setScalingEnabled(false, false);
m_widget->setKeepAspectRatio(Qt::IgnoreAspectRatio);
m_widget->setFadingEnabled(false);
- m_ui = new Ui::PracticeMainWindow();
m_ui->setupUi(m_widget);
m_ui->centralPracticeWidget->setLayout(new QHBoxLayout());
- m_themedBackgroundRenderer = new ThemedBackgroundRenderer(this, QStringLiteral("practicethemecache.bin"));
-
connect(Prefs::self(), &Prefs::configChanged, this, &GuiFrontend::setTheme);
setTheme();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/practice/guifrontend.h new/parley-16.08.0/src/practice/guifrontend.h
--- old/parley-16.04.3/src/practice/guifrontend.h 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/practice/guifrontend.h 2016-07-28 15:11:23.000000000 +0200
@@ -39,7 +39,7 @@
Q_OBJECT
public:
- GuiFrontend(QWidget* parent = 0);
+ GuiFrontend(QWidget *parent = 0);
virtual ~GuiFrontend();
virtual QVariant userInput();
@@ -103,9 +103,9 @@
private:
void setImage(const QUrl& image);
- ImageWidget* m_widget;
- Ui::PracticeMainWindow* m_ui;
- AbstractModeWidget* m_modeWidget;
+ ImageWidget *m_widget;
+ Ui::PracticeMainWindow *m_ui;
+ AbstractModeWidget *m_modeWidget;
ResultState m_resultState;
ResultState m_feedbackState;
QUrl m_lastImage;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/practice/imagecache.cpp new/parley-16.08.0/src/practice/imagecache.cpp
--- old/parley-16.04.3/src/practice/imagecache.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/practice/imagecache.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -14,6 +14,7 @@
#include "imagecache.h"
#include <QFileInfo>
+#include <QDir>
#include <QDataStream>
#include <QDebug>
@@ -57,10 +58,23 @@
return m_images.value(id);
}
+void ImageCache::setSaveFilename(const QString &filename)
+{
+ m_saveFilename = filename;
+ QDir fileDir = QFileInfo(filename).absoluteDir();
+ if (!fileDir.exists() && !fileDir.mkpath(QStringLiteral("."))) {
+ qWarning() << QStringLiteral("Couldn't create image cache path: ") << fileDir.absolutePath();
+ }
+}
+
void ImageCache::openCache()
{
QFile file(m_saveFilename);
- file.open(QIODevice::ReadOnly);
+ if (!file.open(QIODevice::ReadOnly)) {
+ // If cache is used for the first time it's normal to fail here,
+ // because cache file doesn't exist at this time.
+ return;
+ }
QDataStream stream(&file);
// check identifier
QString temp;
@@ -112,3 +126,4 @@
dbg.nospace() << "\n\ttotal pixel count: " << pixels << " (approx. " << double(pixels) * 4 / 1024 / 1024 << " MiB)";
return dbg.space();
}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/practice/imagecache.h new/parley-16.08.0/src/practice/imagecache.h
--- old/parley-16.04.3/src/practice/imagecache.h 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/practice/imagecache.h 2016-07-28 15:11:23.000000000 +0200
@@ -39,9 +39,7 @@
return m_images.isEmpty();
}
- void setSaveFilename(const QString& filename) {
- m_saveFilename = filename;
- }
+ void setSaveFilename(const QString &filename);
void openCache();
void saveCache();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/practice/practicemainwindow.cpp new/parley-16.08.0/src/practice/practicemainwindow.cpp
--- old/parley-16.04.3/src/practice/practicemainwindow.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/practice/practicemainwindow.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -59,8 +59,6 @@
KConfigGroup cfg(KSharedConfig::openConfig(QStringLiteral("parleyrc")), objectName());
applyMainWindowSettings(cfg);
-
- I18N_NOOP("I knew it well");
}
PracticeMainWindow::~PracticeMainWindow()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/practice/practicestatemachine.cpp new/parley-16.08.0/src/practice/practicestatemachine.cpp
--- old/parley-16.04.3/src/practice/practicestatemachine.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/practice/practicestatemachine.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -221,8 +221,8 @@
m_frontend->setBoxes(grade, goodGrade, KV_LEV1_GRADE);
- QString imgFrom = m_current->entry()->translation(m_current->languageFrom())->imageUrl().url();
- QString imgTo = m_current->entry()->translation(m_current->languageTo())->imageUrl().url();
+ QUrl imgFrom = m_current->entry()->translation(m_current->languageFrom())->imageUrl();
+ QUrl imgTo = m_current->entry()->translation(m_current->languageTo())->imageUrl();
if (imgFrom.isEmpty()) {
imgFrom = imgTo;
}
@@ -232,12 +232,12 @@
if (Prefs::flashcardsFrontImage()) {
m_frontend->setQuestionImage(imgFrom);
} else {
- m_frontend->setQuestionImage(QString());
+ m_frontend->setQuestionImage(QUrl());
}
if (Prefs::flashcardsBackImage()) {
m_frontend->setSolutionImage(imgTo);
} else {
- m_frontend->setSolutionImage(QString());
+ m_frontend->setSolutionImage(QUrl());
}
m_frontend->showQuestion();
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/practice/sessionmanagerbase.cpp new/parley-16.08.0/src/practice/sessionmanagerbase.cpp
--- old/parley-16.04.3/src/practice/sessionmanagerbase.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/practice/sessionmanagerbase.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -251,7 +251,7 @@
// if the current entry has predefined multiple choice entries definied, use them first
TestEntry *currentEntry = m_currentEntries.at(m_currentEntry);
- QStringList predefinedChoices = currentEntry->entry()->translation(currentEntry->languageTo())->multipleChoice();
+ QStringList predefinedChoices = currentEntry->entry()->translation(currentEntry->languageTo())->getMultipleChoice();
while (!predefinedChoices.isEmpty() && count > 0) {
choices.append(predefinedChoices.takeAt(KRandom::random() % predefinedChoices.count()));
count--;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/practice/themedbackgroundrenderer.cpp new/parley-16.08.0/src/practice/themedbackgroundrenderer.cpp
--- old/parley-16.04.3/src/practice/themedbackgroundrenderer.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/practice/themedbackgroundrenderer.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -29,7 +29,7 @@
: QObject(parent), m_haveCache(true), m_queuedRequest(false), m_isFastScaledRender(true)
{
m_theme = new KGameTheme();
- m_cache.setSaveFilename(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + '/' + cacheFilename);
+ m_cache.setSaveFilename(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + '/' + cacheFilename);
m_timer.setSingleShot(true);
m_timer.setInterval(1000);
connect(&m_timer, &QTimer::timeout, this, &ThemedBackgroundRenderer::updateBackgroundTimeout);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/scripts/scripting/container.h new/parley-16.08.0/src/scripts/scripting/container.h
--- old/parley-16.04.3/src/scripts/scripting/container.h 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/scripts/scripting/container.h 2016-07-28 15:11:23.000000000 +0200
@@ -130,7 +130,7 @@
* @param url url of the image
*/
void setImageUrl(const QString & url) {
- m_container->setImageUrl(url);
+ m_container->setImageUrl(QUrl(url));
}
/* finds the container with the given name */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/scripts/scripting/document.h new/parley-16.08.0/src/scripts/scripting/document.h
--- old/parley-16.04.3/src/scripts/scripting/document.h 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/scripts/scripting/document.h 2016-07-28 15:11:23.000000000 +0200
@@ -261,12 +261,12 @@
* Sets the URL of the XML file
*/
void setUrl(const QString& url) {
- m_doc->setUrl(url);
+ m_doc->setUrl(QUrl(url));
}
/* @returns the URL of the XML file */
QString url() const {
- return m_doc->url().path();
+ return m_doc->url().toString();
}
public slots:
@@ -390,7 +390,7 @@
*/
int saveAs(const QString & url, KEduVocDocument::FileType ft = KEduVocDocument::Automatic, const QString & generator = QStringLiteral("Parley")) {
m_doc->setGenerator(generator);
- return m_doc->saveAs(url, ft);
+ return m_doc->saveAs(QUrl(url), ft);
}
// QByteArray toByteArray ( const QString &generator );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/scripts/scripting/translation.cpp new/parley-16.08.0/src/scripts/scripting/translation.cpp
--- old/parley-16.04.3/src/scripts/scripting/translation.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/scripts/scripting/translation.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -46,14 +46,14 @@
void Translation::setConjugationText(const QString& conjugation, const QString& tense, const KEduVocWordFlags& flags)
{
- KEduVocConjugation & conjug = m_translation->conjugation(tense);
+ KEduVocConjugation conjug = m_translation->getConjugation(tense);
conjug.setConjugation(conjugation, flags);
m_translation->setConjugation(tense, conjug);
}
QObject * Translation::conjugation(const QString & tense, const KEduVocWordFlags& flags)
{
- KEduVocConjugation conjug = m_translation->conjugation(tense);
+ KEduVocConjugation conjug = m_translation->getConjugation(tense);
return new Text(conjug.conjugation(flags));
}
@@ -61,7 +61,7 @@
{
Text * txt = dynamic_cast(conjugation);
if (txt) {
- KEduVocConjugation & conjug = m_translation->conjugation(tense);
+ KEduVocConjugation conjug = m_translation->getConjugation(tense);
conjug.setConjugation(*(txt->kEduVocText()), flags);
m_translation->setConjugation(tense, conjug);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/scripts/scripting/translation.h new/parley-16.08.0/src/scripts/scripting/translation.h
--- old/parley-16.04.3/src/scripts/scripting/translation.h 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/scripts/scripting/translation.h 2016-07-28 15:11:23.000000000 +0200
@@ -206,25 +206,25 @@
/* get the sound url for this translation if it exists */
QString soundUrl() {
- return m_translation->soundUrl().path();
+ return m_translation->soundUrl().toString();
}
/* set the sound url for this translation
* @param url url of the sound file */
void setSoundUrl(const QString &url) {
- m_translation->setSoundUrl(url);
+ m_translation->setSoundUrl(QUrl(url));
}
/* get the image url for this translation if it exists */
QString imageUrl() {
- return m_translation->soundUrl().path();
+ return m_translation->soundUrl().toString();
}
/* set the image url for this translation
* @param url url of the image
*/
void setImageUrl(const QString &url) {
- m_translation->setImageUrl(url);
+ m_translation->setImageUrl(QUrl(url));
}
/*
@@ -321,7 +321,7 @@
/** returns multiple choice if available */
QStringList multipleChoice() {
- return m_translation->multipleChoice();
+ return m_translation->getMultipleChoice();
}
/** returns a string list with the available conjugation tenses */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/scripts/translator.cpp new/parley-16.08.0/src/scripts/translator.cpp
--- old/parley-16.04.3/src/scripts/translator.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/scripts/translator.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -18,6 +18,7 @@
#include <QDebug>
Translator::Translator()
+ : m_parent(nullptr)
{
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/settings/kgametheme/kgamethemeselector.cpp new/parley-16.08.0/src/settings/kgametheme/kgamethemeselector.cpp
--- old/parley-16.04.3/src/settings/kgametheme/kgamethemeselector.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/settings/kgametheme/kgamethemeselector.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -48,7 +48,7 @@
// private slots
void _k_updatePreview();
- void _k_updateThemeList(const QString& strTheme);
+ void _k_updateThemeList(const QString &strTheme);
void _k_openKNewStuffDialog();
};
@@ -186,13 +186,23 @@
ui.themePreview->setPixmap(pix.scaled(ui.themePreview->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
}
-void KGameThemeSelectorPrivate::_k_updateThemeList(const QString& strTheme)
+void KGameThemeSelectorPrivate::_k_updateThemeList(const QString &strTheme)
{
//find theme and set selection to the current theme; happens when pressing "Default"
- QListWidgetItem * currentItem = ui.themeList->currentItem();
- if (!currentItem || themeMap.value(currentItem->text())->fileName() != strTheme) {
+ QListWidgetItem *currentItem = ui.themeList->currentItem();
+
+ QString currentGameThemeFileName;
+ if (currentItem) {
+ KGameTheme *currentGameTheme = themeMap.value(currentItem->text());
+ if (currentGameTheme) {
+ currentGameThemeFileName = currentGameTheme->fileName();
+ }
+ }
+
+ if (!currentItem || (currentGameThemeFileName != strTheme)) {
for (int i = 0; i < ui.themeList->count(); i++) {
- if (themeMap.value(ui.themeList->item(i)->text())->fileName() == strTheme) {
+ KGameTheme *listItemGameTheme = themeMap.value(ui.themeList->item(i)->text());
+ if (listItemGameTheme && (listItemGameTheme->fileName() == strTheme)) {
ui.themeList->setCurrentItem(ui.themeList->item(i));
break;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.3/src/statistics/statisticslegendwidget.cpp new/parley-16.08.0/src/statistics/statisticslegendwidget.cpp
--- old/parley-16.04.3/src/statistics/statisticslegendwidget.cpp 2016-06-18 18:29:44.000000000 +0200
+++ new/parley-16.08.0/src/statistics/statisticslegendwidget.cpp 2016-07-28 15:11:23.000000000 +0200
@@ -67,11 +67,6 @@
QString rightString = i18nc("adjective, The word has not even been practiced once by the user","Not practiced");
QFontMetrics fontMetrics(painter.font());
- I18N_NOOP("Initial phase");
- I18N_NOOP("Long term phase");
- I18N_NOOP("Invalid entry");
- I18N_NOOP("Newly started");
-
// Calculate the size and position of the rectangle that will contain the
// string on the left side of the legend.
QRect leftRect = fontMetrics.boundingRect(leftString);