| The Following 2 Users Say Thank You to attila77 For This Useful Post: | ||
|
|
2010-06-12
, 08:21
|
|
Posts: 16 |
Thanked: 6 times |
Joined on Mar 2010
@ Germany
|
#632
|
| The Following User Says Thank You to bonsai009 For This Useful Post: | ||
|
|
2010-06-12
, 08:28
|
|
|
Posts: 3,203 |
Thanked: 1,391 times |
Joined on Nov 2009
@ Worthing, England
|
#633
|
application crash after starting...
g = gn_functions.funcMaemoVersion()
File "/opt/healthcheck/gn_functions.py", line 196, in funcMaemoVersion
g = s[2].strip()
IndexError: list index out of range
What is wrong?

dpkg -l mp-fremantle-* | grep ii
|
|
2010-06-12
, 08:46
|
|
Posts: 16 |
Thanked: 6 times |
Joined on Mar 2010
@ Germany
|
#634
|
|
|
2010-06-12
, 08:49
|
|
Posts: 16 |
Thanked: 6 times |
Joined on Mar 2010
@ Germany
|
#635
|
|
|
2010-06-12
, 08:49
|
|
|
Posts: 1,296 |
Thanked: 1,773 times |
Joined on Aug 2009
@ Budapest, Hungary
|
#636
|
Any examples will help - i'm getting used to translating examples from GTK and c++!

...
//include whatever...
class MainWindow
{
...
private:
QTimer *timer;
...
public:
MainWindow(...); // constructor
void updateAll(); // method that updates all
...
private slots:
void on_timer_timeout(); // the method
...
}
#include "MainWindow.h"
class UpdaterRunnable : private QRunnable
{
private:
MainWindow *myWindow;
public:
UpdaterRunnable(MainWindow *window);
void run();
}
#include "MainWindow.h"
#include "UpdaterRunnable.h"
MainWindow::MainWindow(...)
{
// creating a new timer instance on the heap
timer = new QTimer(this);
// connecting to its signal
connect(timer, SIGNAL(timeout()), this, SLOT(on_timer_timeout()));
// running the timeout method - to fill up values on the beginning
on_timer_timeout();
// starting the timer with a nice interval
timer->start(3000);
...
}
void MainWindow::updateAll()
{
// This is the method in which you update all your labels
}
void MainWindow::on_timer_timeout()
{
// makes the thread pool start updating asynchronously
// note that the QRunnable instance will be deleted by the thread pool, so this is not a memory leak
QThreadPool::globalInstance()->start(new UpdaterRunnable(this));
}
#include "UpdaterRunnable.h"
UpdaterRunnable::UpdaterRunnable(MainWindow *window)
: QRunnable(), myWindow(window)
{
}
void UpdaterRunnable::run()
{
myWindow->updateAll();
}
| The Following 2 Users Say Thank You to Venemo For This Useful Post: | ||
|
|
2010-06-12
, 09:03
|
|
|
Posts: 3,203 |
Thanked: 1,391 times |
Joined on Nov 2009
@ Worthing, England
|
#637
|
Nokia-N900:~# dpkg -l mp-fremantle-*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=============================-=============================-================================================== ========================
pn mp-fremantle-generic-pr <none> (no description available)
sorry for bad english, I´m a german-people
|
|
2010-06-12
, 09:08
|
|
|
Posts: 1,296 |
Thanked: 1,773 times |
Joined on Aug 2009
@ Budapest, Hungary
|
#638
|
it is very odd though. it looks like you do not have maemo installed! never expected no value being returned! anyone else got any suggestions?
| The Following User Says Thank You to Venemo For This Useful Post: | ||
|
|
2010-06-12
, 09:13
|
|
|
Posts: 1,366 |
Thanked: 1,185 times |
Joined on Jan 2006
|
#639
|
Okay, I'm sold!
I don't guarantee syntax rightness, though, because I'm typing it rigt in here, not into my IDE.
I also only write my idea, I guess the "..."s will make sense.
MainWindow.h
UpdaterRunnable.hCode:... //include whatever... class MainWindow { ... private: QTimer *timer; ... public: MainWindow(...); // constructor void updateAll(); // method that updates all ... private slots: void on_timer_timeout(); // the method ... }
MainWindow.cppCode:#include "MainWindow.h" class UpdaterRunnable : private QRunnable { private: MainWindow *myWindow; public: UpdaterRunnable(MainWindow *window); void run(); }
UpdaterRunnable.cppCode:#include "MainWindow.h" #include "UpdaterRunnable.h" MainWindow::MainWindow(...) { // creating a new timer instance on the heap timer = new QTimer(this); // connecting to its signal connect(timer, SIGNAL(timeout()), this, SLOT(on_timer_timeout())); // running the timeout method - to fill up values on the beginning on_timer_timeout(); // starting the timer with a nice interval timer->start(3000); ... } void MainWindow::updateAll() { // This is the method in which you update all your labels } void MainWindow::on_timer_timeout() { // makes the thread pool start updating asynchronously // note that the QRunnable instance will be deleted by the thread pool, so this is not a memory leak QThreadPool::globalInstance()->start(new UpdaterRunnable(this)); }
Rougly this is what I was speaking about - I really hope it helps.Code:#include "UpdaterRunnable.h" UpdaterRunnable::UpdaterRunnable(MainWindow *window) : QRunnable(), myWindow(window) { } void UpdaterRunnable::run() { myWindow->updateAll(); }
I also recommend setting the default caption of all labels to "Updating...", and start updating them asynchonously. It just adds a feeling of responsiveness to the UI. (This is why there is a call to the timeout method in the constructor of my example.)
| The Following 2 Users Say Thank You to mikec For This Useful Post: | ||
|
|
2010-06-12
, 09:30
|
|
|
Posts: 3,203 |
Thanked: 1,391 times |
Joined on Nov 2009
@ Worthing, England
|
#640
|
| The Following User Says Thank You to noobmonkey For This Useful Post: | ||
![]() |
| Tags |
| check, faulty, front camera, gps, hardware, healthcheck, test |
|
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc