Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to supported version #269

Open
wants to merge 96 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
5c3d2f7
Fix for QObject* ownership bugs
412b May 20, 2015
7591602
added missed parents
412b May 24, 2015
ad91813
Merge remote-tracking branch 'upstream/master' into qt-qml-fixing-own…
412b May 24, 2015
f3b8e77
not that easy there, leaving a FIXME for the next round
412b May 24, 2015
d04434e
added missing destructors
412b May 28, 2015
43dd963
fixing leaks
412b May 28, 2015
2b46f13
ownership, concurrency and and destructor for parser backend manager and
412b May 28, 2015
7b97514
clearJourney() is a more proper name
412b May 31, 2015
3b16f28
adding clearJourney to EFA parser
412b May 31, 2015
32243d8
fixing ParserXmlVasttrafikSe memory leaks
412b May 31, 2015
cf3ad03
one more small fix to vasttrafikse
412b May 31, 2015
486eb79
fixing ninetwo memory leaks
412b May 31, 2015
52a8675
fixing resrobot memory leaks
412b May 31, 2015
8741cfa
providing clearJourney at the top level
412b May 31, 2015
12260d3
Fix for QObject* ownership bugs
412b May 20, 2015
c01f35f
added missed parents
412b May 24, 2015
90dc51c
not that easy there, leaving a FIXME for the next round
412b May 24, 2015
491f62f
added missing destructors
412b May 28, 2015
1c97540
fixing leaks
412b May 28, 2015
ca2363e
ownership, concurrency and and destructor for parser backend manager and
412b May 28, 2015
6ab36b3
clearJourney() is a more proper name
412b May 31, 2015
f564acb
adding clearJourney to EFA parser
412b May 31, 2015
4e9d150
fixing ParserXmlVasttrafikSe memory leaks
412b May 31, 2015
88e23bd
one more small fix to vasttrafikse
412b May 31, 2015
7f7411d
fixing ninetwo memory leaks
412b May 31, 2015
ae0c3f5
fixing resrobot memory leaks
412b May 31, 2015
9578c88
providing clearJourney at the top level
412b May 31, 2015
17bc132
added missed parents
412b May 24, 2015
a8d240c
not that easy there, leaving a FIXME for the next round
412b May 24, 2015
253877b
fixing leaks
412b May 28, 2015
bb6c564
clearJourney() is a more proper name
412b May 31, 2015
c766afa
fixing ParserXmlVasttrafikSe memory leaks
412b May 31, 2015
d2be213
one more small fix to vasttrafikse
412b May 31, 2015
26a0b54
Merge branch 'qt-qml-fixing-ownership-rebased' of github.com:412b/
412b Jun 1, 2015
adff4e2
Fix for QObject* ownership bugs
412b May 20, 2015
b3a2b76
added missed parents
412b May 24, 2015
98201ac
not that easy there, leaving a FIXME for the next round
412b May 24, 2015
35db43b
added missing destructors
412b May 28, 2015
bfdeedc
fixing leaks
412b May 28, 2015
02eff80
ownership, concurrency and and destructor for parser backend manager and
412b May 28, 2015
95604c5
clearJourney() is a more proper name
412b May 31, 2015
2cea328
adding clearJourney to EFA parser
412b May 31, 2015
bc82fa0
fixing ParserXmlVasttrafikSe memory leaks
412b May 31, 2015
9076fb0
one more small fix to vasttrafikse
412b May 31, 2015
3a00949
fixing ninetwo memory leaks
412b May 31, 2015
420764f
fixing resrobot memory leaks
412b May 31, 2015
fe93c97
providing clearJourney at the top level
412b May 31, 2015
57a638d
added missed parents
412b May 24, 2015
42c88a8
not that easy there, leaving a FIXME for the next round
412b May 24, 2015
a43589c
fixing leaks
412b May 28, 2015
92be2e1
clearJourney() is a more proper name
412b May 31, 2015
ea6fcbb
fixing ParserXmlVasttrafikSe memory leaks
412b May 31, 2015
4897391
one more small fix to vasttrafikse
412b May 31, 2015
6930cf9
upstreaming
Jun 13, 2015
c301e1d
Merge branch 'qt-qml-fixing-ownership-rebased' of github.com:412b/fah…
412b Jun 13, 2015
1a1eb14
added clear journey api to be able to free memory as soon as possible
412b Jun 13, 2015
208ad3e
additional control on destruction
412b Jun 13, 2015
ab694db
Merge remote-tracking branch 'refs/remotes/upstream/master' into qt-q…
412b Jun 13, 2015
6ab413e
minor ownership fixes and memory leak fixes
412b Jun 19, 2015
4db74e8
cleaning up lastJourneyResultList initialization in ctors
412b Jun 19, 2015
16fc039
finalizing cleanups and fixes
412b Jun 19, 2015
0479942
ensure calling clearJourney() in all the paths (search, search earlier,
412b Jun 23, 2015
7c55711
Adding RMV.de for southern/central Hesse, Germany
thfi Jul 29, 2016
0290d60
start london prototype
balcy Jan 13, 2018
5847268
continue prototyping TFL
balcy Jan 14, 2018
1ab4890
add stopPoint / platform info
balcy Jan 18, 2018
0001b03
add indent parameter to parser_abstract, serializeToJson
balcy Jan 22, 2018
a488526
- add icsId and naptanId to configuration
balcy Jan 22, 2018
405725b
work on parseStationsByCoordinates(), findStationsByCoordinates(), ad…
balcy Jan 29, 2018
70bc276
code cleanup, use bus stop symbol
balcy Feb 3, 2018
fa50aee
if platform name is null (e.g. bus stop without letter) omit it
balcy Feb 7, 2018
a6f1089
improve platform display of arrivals
balcy Feb 12, 2018
ba809ab
bump version
balcy Feb 14, 2018
7de6357
make qt4 build work
balcy Feb 14, 2018
60effd4
add color support for TFL parser / Ubuntu touch
balcy Feb 20, 2018
19ba0e5
Merge pull request #2 from balcy/london
Feb 20, 2018
e19cff3
make color maps static
balcy Feb 21, 2018
0912bbb
add colors for river-boat/river-tour
balcy Feb 28, 2018
109ca6d
Merge pull request #3 from balcy/london
Feb 28, 2018
3dc182f
match open store version
Mar 30, 2018
f0f2c6c
change qml page headers for ubuntu (Ubuntu.Components 1.3 warnings re…
balcy May 9, 2018
8a9e4d1
Merge pull request #4 from balcy/london
May 10, 2018
7c79f82
time format adjustments
balcy May 13, 2018
e27e23b
correction of time format
balcy May 19, 2018
366ca3a
Merge branch 'qt-qml-fixing-ownership-rebased' of https://github.com/…
balcy May 19, 2018
9433014
corrections to parser_resrobot
balcy May 19, 2018
463ff3e
restore harbour file (do not take changes from PR)
balcy May 19, 2018
3d251c0
original order
balcy May 19, 2018
69f9b9e
add cleanup to london parser
balcy May 19, 2018
de169b2
Merge branch 'rmv' of https://github.com/thfi/fahrplan into 412b-qt-q…
balcy May 19, 2018
7296824
ubuntu gui adaption for parsers that do not support timetable, correc…
balcy May 21, 2018
2aef7c6
minor change london parser
balcy Jun 3, 2018
aaa1589
raise version
balcy Jun 3, 2018
ccab3d6
Merge pull request #7 from balcy/412b-qt-qml-fixing-ownership-rebased
Jun 3, 2018
e35efbe
Change layout height to make full text visible on the About page's Cr…
ennedin Sep 13, 2018
66bc527
Merge pull request #4 from ennedin/correct-aboutpage
dayrover Sep 23, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.directory
/.qmake.*
/.clickable/
/.make.cache
/Makefile
Expand All @@ -12,3 +13,4 @@
/run_on_ubuntu_touch.sh
/tmp/
/translations/*.qm
/rpm/harbour-fahrplan2.spec
5 changes: 3 additions & 2 deletions clickable.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"clean_tmp": "rm -rf ./tmp/*"
},
"template": "custom",
"build": "bash -c 'cd ..; ./clickableCustomBuild.sh click_build'",
"build": "bash -c 'cd ..; ./clickableCustomBuild.sh click_build/tmp'",
"dependencies": [ "libcurl4-gnutls-dev" ],
"default" : "kill clean clean_tmp build click-build install launch"
"default" : "kill clean clean_tmp build click-build install launch",
"ssh_" : "bq.fritz.box"
}
9 changes: 1 addition & 8 deletions clickableCustomBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,8 @@ if [[ -z "$clickBuildFolder" ]]
exit 1
fi

# make sure we are in an armhf environment
if [[ ! -d "/usr/lib/arm-linux-gnueabihf" ]]
then
echo "this script has to be run in an armhf container (e.g. docker, chroot or libertine)"
exit 1
fi

# determine qmake (e.g. cross compiler or direct)
if [[ -n $(which qt5-qmake-arm-linux-gnueabihf) ]]
if [[ -n $(which qt5-qmake-arm-linux-gnueabihf) && -d "/usr/lib/arm-linux-gnueabihf" ]]
then
QMAKE=qt5-qmake-arm-linux-gnueabihf
else
Expand Down
6 changes: 5 additions & 1 deletion fahrplan2.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
APP_NAME = Fahrplan

# Define Version
VERSION = 2.0.32-2
VERSION = 2.0.33-2

# Switch for jolla to separate harbour and openrepo version
openrepos {
Expand Down Expand Up @@ -129,6 +129,8 @@ HEADERS += \
src/parser/parser_salzburg_efa.h \
src/parser/parser_resrobot.h \
src/parser/parser_finland_matka.h \
src/parser/parser_london_tfl.h \
src/parser/parser_xmlrmvde.h \
src/models/backends.h

SOURCES += src/main.cpp \
Expand Down Expand Up @@ -163,6 +165,8 @@ SOURCES += src/main.cpp \
src/parser/parser_salzburg_efa.cpp \
src/parser/parser_resrobot.cpp \
src/parser/parser_finland_matka.cpp \
src/parser/parser_london_tfl.cpp \
src/parser/parser_xmlrmvde.cpp \
src/models/backends.cpp

LIBS += $$PWD/3rdparty/gauss-kruger-cpp/gausskruger.cpp
Expand Down
50 changes: 48 additions & 2 deletions src/fahrplan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ Fahrplan::Fahrplan(QObject *parent)
, m_mode(DepartureMode)
, m_dateTime(QDateTime::currentDateTime())
{
settings = new QSettings(FAHRPLAN_SETTINGS_NAMESPACE, "fahrplan2");
settings = new QSettings(FAHRPLAN_SETTINGS_NAMESPACE, "fahrplan2", this);
setMode(static_cast<Mode>(settings->value("mode", DepartureMode).toInt()));

if (!m_parser_manager) {
int currentBackend = settings->value("currentBackend", 0).toInt();
m_parser_manager = new FahrplanBackendManager(currentBackend);
m_parser_manager = new FahrplanBackendManager(currentBackend, this);
}
connect(m_parser_manager, SIGNAL(parserChanged(const QString &, int)), this, SLOT(onParserChanged(const QString &, int)));

Expand Down Expand Up @@ -80,6 +80,41 @@ Fahrplan::Fahrplan(QObject *parent)
}
}

Fahrplan::~Fahrplan()
{
qDebug() << this;

if (m_trainrestrictions) {
delete m_trainrestrictions;
}

if (m_timetable) {
delete m_timetable;
}

if (m_stationSearchResults) {
disconnect(m_stationSearchResults, SIGNAL(stationSelected(Fahrplan::StationType,Station)),
this, SLOT(setStation(Fahrplan::StationType,Station)));
delete m_stationSearchResults;
}

if (m_favorites) {
disconnect(m_favorites, SIGNAL(stationSelected(Fahrplan::StationType,Station)),
this, SLOT(setStation(Fahrplan::StationType,Station)));
delete m_favorites;
}

if (m_parser_manager) {
unbindParserSignals();
disconnect(m_parser_manager, SIGNAL(parserChanged(const QString &, int)), this, SLOT(onParserChanged(const QString &, int)));
delete m_parser_manager;
}

if (settings) {
delete settings;
}
}

void Fahrplan::bindParserSignals()
{
if (m_parser_manager->getParser()) {
Expand All @@ -91,6 +126,17 @@ void Fahrplan::bindParserSignals()
}
}

void Fahrplan::unbindParserSignals()
{
if (m_parser_manager->getParser()) {
disconnect(m_parser_manager->getParser(), SIGNAL(stationsResult(StationsList)), this, SLOT(onStationSearchResults(StationsList)));
disconnect(m_parser_manager->getParser(), SIGNAL(journeyResult(JourneyResultList*)), this, SIGNAL(parserJourneyResult(JourneyResultList*)));
disconnect(m_parser_manager->getParser(), SIGNAL(errorOccured(QString)), this, SIGNAL(parserErrorOccured(QString)));
disconnect(m_parser_manager->getParser(), SIGNAL(journeyDetailsResult(JourneyDetailResultList*)), this, SIGNAL(parserJourneyDetailsResult(JourneyDetailResultList*)));
disconnect(m_parser_manager->getParser(), SIGNAL(timeTableResult(TimetableEntriesList)), this, SLOT(onTimetableResult(TimetableEntriesList)));
}
}

void Fahrplan::storeSettingsValue(const QString &key, const QString &value)
{
settings->setValue(key, value);
Expand Down
2 changes: 2 additions & 0 deletions src/fahrplan.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class Fahrplan : public QObject
};

explicit Fahrplan(QObject *parent = 0);
virtual ~Fahrplan();
FahrplanParserThread *parser();
Favorites *favorites() const;
QString parserName() const;
Expand Down Expand Up @@ -143,6 +144,7 @@ class Fahrplan : public QObject
void onStationSearchResults(const StationsList &result);
void onTimetableResult(const TimetableEntriesList &timetableEntries);
void bindParserSignals();
void unbindParserSignals();

private:
static FahrplanBackendManager *m_parser_manager;
Expand Down
12 changes: 11 additions & 1 deletion src/fahrplan_backend_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ FahrplanBackendManager::FahrplanBackendManager(int defaultParser, QObject *paren
currentParserIndex = defaultParser;
}

FahrplanBackendManager::~FahrplanBackendManager()
{
if (m_parser) {
// Parser object will be autodeleted after the thread quits.
m_parser->quit();
}
}

QStringList FahrplanBackendManager::getParserList()
{
QStringList result;
Expand All @@ -45,6 +53,8 @@ QStringList FahrplanBackendManager::getParserList()
result.append(ParserSalzburgEFA::getName());
result.append(ParserResRobot::getName());
result.append(ParserFinlandMatka::getName());
result.append(ParserLondonTfl::getName());
result.append(ParserXmlRMVde::getName());

// Make sure the index is in bounds
if (currentParserIndex > (result.count() - 1) || currentParserIndex < 0) {
Expand Down Expand Up @@ -73,7 +83,7 @@ void FahrplanBackendManager::setParser(int index)
m_parser->quit();
}

m_parser = new FahrplanParserThread();
m_parser = new FahrplanParserThread(this);
m_parser->init(index);

// Init can fallback to another index if its invalid.
Expand Down
1 change: 1 addition & 0 deletions src/fahrplan_backend_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class FahrplanBackendManager : public QObject

public:
explicit FahrplanBackendManager(int defaultParser, QObject *parent = 0);
virtual ~FahrplanBackendManager();
QStringList getParserList();
void setParser(int index);
FahrplanParserThread *getParser();
Expand Down
12 changes: 12 additions & 0 deletions src/fahrplan_parser_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ void FahrplanParserThread::cancelRequest()
emit requestCancelRequest();
}

void FahrplanParserThread::clearJourney()
{
emit requestClearJourney();
}

QString FahrplanParserThread::name() {
return m_name;
}
Expand Down Expand Up @@ -170,6 +175,12 @@ void FahrplanParserThread::run()
case 15:
m_parser = new ParserFinlandMatka();
break;
case 16:
m_parser = new ParserLondonTfl();
break;
case 17:
m_parser = new ParserXmlRMVde();
break;
}

m_name = m_parser->name();
Expand All @@ -191,6 +202,7 @@ void FahrplanParserThread::run()
connect(this, SIGNAL(requestSearchJourney(Station,Station,Station,QDateTime,ParserAbstract::Mode,int)), m_parser, SLOT(searchJourney(Station,Station,Station,QDateTime,ParserAbstract::Mode,int)), Qt::QueuedConnection);
connect(this, SIGNAL(requestSearchJourneyEarlier()), m_parser, SLOT(searchJourneyEarlier()), Qt::QueuedConnection);
connect(this, SIGNAL(requestSearchJourneyLater()), m_parser, SLOT(searchJourneyLater()), Qt::QueuedConnection);
connect(this, SIGNAL(requestClearJourney()), m_parser, SLOT(clearJourney()), Qt::QueuedConnection);

//Connect parser responses with threads corresponding results
connect(m_parser, SIGNAL(errorOccured(QString)), this, SIGNAL(errorOccured(QString)), Qt::QueuedConnection);
Expand Down
6 changes: 5 additions & 1 deletion src/fahrplan_parser_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include "parser/parser_salzburg_efa.h"
#include "parser/parser_resrobot.h"
#include "parser/parser_finland_matka.h"
#include "parser/parser_london_tfl.h"
#include "parser/parser_xmlrmvde.h"

class FahrplanParserThread : public QThread
{
Expand All @@ -57,6 +59,7 @@ class FahrplanParserThread : public QThread
void requestSearchJourneyEarlier();
void requestGetJourneyDetails(const QString &id);
void requestCancelRequest();
void requestClearJourney();

//Real ones
void stationsResult(const StationsList &result);
Expand All @@ -77,6 +80,7 @@ public slots:
void searchJourneyEarlier();
void getJourneyDetails(const QString &id);
void cancelRequest();
void clearJourney();

bool supportsGps();
bool supportsVia();
Expand All @@ -91,7 +95,7 @@ public slots:
void run();

private:
bool m_ready;
volatile bool m_ready;
int i_parser;

QStringList m_trainrestrictions;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/desktop-test/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void MainWindow::timeTableResult()
for (int i=0; i < fahrplan->timetable()->count(); i++) {
QModelIndex index = fahrplan->timetable()->index(i, 0, QModelIndex());
ui->searchJourneyResults->append(fahrplan->timetable()->data(index, Timetable::CurrentStation).toString());
ui->searchJourneyResults->append(fahrplan->timetable()->data(index, Timetable::Time).toTime().toString(QLocale().timeFormat(QLocale::ShortFormat)));
ui->searchJourneyResults->append(fahrplan->timetable()->data(index, Timetable::Time).toTime().toString("HH:mm"));
ui->searchJourneyResults->append(fahrplan->timetable()->data(index, Timetable::DestinationStation).toString());
ui->searchJourneyResults->append(fahrplan->timetable()->data(index, Timetable::TrainType).toString());
ui->searchJourneyResults->append(fahrplan->timetable()->data(index, Timetable::Platform).toString());
Expand Down
4 changes: 2 additions & 2 deletions src/gui/ubuntu/AboutPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ Page {

Item {
width: tabView.width
height: tabView.height
height: tabView.height - header.height

Flickable {
clip: true
anchors.fill: parent
flickableDirection: Flickable.VerticalFlick

contentWidth: width
contentHeight: creditsColumn.height + units.gu(2)
contentHeight: creditsColumn.height + units.gu(4)

Column {
id: creditsColumn
Expand Down
Loading