Skip to content

Commit

Permalink
TODO: device has become super slow
Browse files Browse the repository at this point in the history
  • Loading branch information
dpeytonX committed Jan 6, 2015
1 parent 684520e commit 6a472a9
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 213 deletions.
1 change: 0 additions & 1 deletion harbour-nemosyne.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ Name=Nemosyne
# your app name in German locale (de)
Name[de]=Nemosyne
Name[ja]=Nemosyne
Name[en]=Nemosyne

6 changes: 4 additions & 2 deletions harbour-nemosyne.pro
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ TARGET = harbour-nemosyne

CONFIG += sailfishapp

QMAKE_CXXFLAGS += "-std=c++0x"
QT += sql

#QMAKE_CXXFLAGS += "-std=c++0x"

SOURCES += src/harbour-nemosyne.cpp

Expand All @@ -34,7 +36,7 @@ INSTALLS += nemosyne
# to disable building translations every time, comment out the
# following CONFIG line
CONFIG += sailfishapp_i18n
TRANSLATIONS += translations/harbour-nemosyne-ja.ts translations/harbour-nemosyne-en.ts
TRANSLATIONS += translations/harbour-nemosyne-ja.ts

RESOURCES += \
images.qrc \
Expand Down
1 change: 0 additions & 1 deletion harbour/nemosyne/Nemosyne/UIConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var appName = "harbour-nemosyne"
var appIcon = "qrc:///images/desktop.png"
var appTitle = "Nemosyne"
var appAuthors = ["Dametrious Peyton", "Thomas Amler - for AboutPage"]
var appDescription = "A mobile flash card tool"
var appCopyright = "Dametrious Peyton"
var appLicense = ["GPLv3"]
var appProjectInfo = ["https://github.com/prplmnky/harbour-nemosyne",
Expand Down
2 changes: 1 addition & 1 deletion qml/harbour-nemosyne.qml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import QtQuick 2.0
import QtQuick 2.1
import Sailfish.Silica 1.0
import harbour.nemosyne.QmlLogger 2.0
import "cover"
Expand Down
1 change: 0 additions & 1 deletion qml/pages/Answer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Page {
x: Theme.paddingLarge
Paragraph {
color: Theme.primaryColor
//height: parent.height;
width: parent.width;
text: answer
}
Expand Down
16 changes: 11 additions & 5 deletions qml/pages/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Page {
if(settings.recentFile == filePath) {
Console.info("Main::openDb: currentFile is equal to recentFile")
} else {
var t = Date.now()
Console.info("Main::openDb: reset history " + t)
settings.recentFile3 = settings.recentFile2
settings.recentFile2 = settings.recentFile1
settings.recentFile1 = settings.recentFile
Expand All @@ -38,6 +40,7 @@ Page {
Console.debug("Main::openDb " + settings.recentFile2)
Console.debug("Main::openDb " + settings.recentFile1)
Console.debug("Main::openDb " + settings.recentFile)
Console.info("Main::openDb: reset history took " + (Date.now() - t) + "ms")
}

// push new card on page stack
Expand Down Expand Up @@ -65,7 +68,7 @@ Page {
Component {
id: aboutDialog
AboutPage {
description: qsTr(UIConstants.appDescription)
description: qsTr("A mobile flash card tool")
icon: UIConstants.appIcon
application: UIConstants.appTitle + " " + UIConstants.appVersion
copyrightHolder: UIConstants.appCopyright
Expand Down Expand Up @@ -164,8 +167,6 @@ Page {
property string recentFile1: ""
property string recentFile2: ""
property string recentFile3: ""

Component.onCompleted: _cleanHistory()
}

Dir {id: dir}
Expand Down Expand Up @@ -276,6 +277,8 @@ Page {
}
}

Component.onCompleted: _cleanHistory()

//----------Internal Functions---------------


Expand Down Expand Up @@ -310,20 +313,23 @@ Page {

function _cleanHistory() {
//Cleanup settings from V 1.0
var t = Date.now()
Console.debug("cleanHistory: start " + t)
var files = [settings.recentFile, settings.recentFile1, settings.recentFile2, settings.recentFile3]

for(var i = 0; i < files.length; i++) {
if(files[i] == "") continue;
for(var j = i+1; j < files.length; j++) {
if(files[i] == files[j]) {
Console.debug("i (" + i + ") and (" + j + ") j are duplicates")
files[j] = j == files.length - 1 ? "" : files[j+1]
i = -1;
break;
}
}
}
settings.recentFile = files[0]
settings.recentFile1 = files[1]
settings.recentFile2 = files[2]
settings.recentFile3 = files[3]
Console.debug("cleanHistory: took " + (Date.now() - t) + "ms")
}
}
5 changes: 3 additions & 2 deletions qml/pages/Question.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ Dialog {
}
}

function _next() {next(-1);}

function _addCard() {
manager.addCard(cardType, questionText, answerText)
if(!card) _next()
Expand Down Expand Up @@ -169,4 +167,7 @@ Dialog {
manager.deleteCard.connect(_next)
}
}


function _next() {next(-1);}
}
12 changes: 0 additions & 12 deletions qml/pages/SettingsPage.qml

This file was deleted.

7 changes: 7 additions & 0 deletions rpm/harbour-nemosyne.changes.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@
- Can iterate through flash cards and rate from 0 through 5
- Maintain a list of recently opened Mnemosyne Databases
- Share progress with the Desktop Mnemosyne app to Nemosyne. Fully compatible

* Mon Jan 5 2015 Dametrious Peyton <dametriouspeyton@countermail.com> 1.1.1-1
- Ability to create a new Mnemosyne compatible database
- Can add, edit, delete cards
- Tweaked recent history
- Created Help, About pages
- Updated Cover actions to cycle through current flash card
3 changes: 0 additions & 3 deletions src/harbour-nemosyne.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
#include <QtQuick>

#include <sailfishapp.h>
#include <stdlib.h>
#include <time.h>

int main(int argc, char *argv[])
{
Expand All @@ -45,7 +43,6 @@ int main(int argc, char *argv[])
//
// To display the view, call "show()" (will show fullscreen on device).

srand(time(NULL));
return SailfishApp::main(argc, argv);
}

185 changes: 0 additions & 185 deletions translations/harbour-nemosyne-en.ts

This file was deleted.

4 changes: 4 additions & 0 deletions translations/harbour-nemosyne-ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
<source>Deleting old database</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>A mobile flash card tool</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Question</name>
Expand Down
4 changes: 4 additions & 0 deletions translations/harbour-nemosyne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
<source>Deleting old database</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>A mobile flash card tool</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Question</name>
Expand Down

0 comments on commit 6a472a9

Please sign in to comment.