[quote author="peppe" date="1306792127"]
Instead, what about setting up the DB so that:
all transactions are logged
the users know they username and password
even with direct, SQL access, an user can do exactly what he can do with your client app
the users are directly responsible for their actions
Now you don't need to store a secret any more.[/quote]
I can do the same with a crypted password. And I add one more security level to what you said.
the fact that "an user can do exactly what he can do with your client app" is not always correct:
suppose an application that add or update a price in a price list. The user must have at least the SELECT, INSERT and UPDATE privileges on the DB.
With this privileges the user can alter all the price table without any software filter.
This is why I'd like to hide db password.
I also think that no one is interested in hacking my application to get the key. :-)
1)I solved the problem with threads:for someone else who has similar problem the solution is:
The connect methods should be in the run method and not to the constructor,because as i understood reading documentation and books,when the thread starts, run method is executing.
@fortuneThread->start();@
2)Thanks peppe,you were right,QDataStream to read raw data was not the best way.
Well, you could do some nasty thing like this:
@typedef QVariant (Obj::*pt2Member)(QList<QVariant> &);
QMap<QString, pt2Member> functions;
..
functions.insert("execute",&Obj::execute());
..
QVariant result = functions["execute"](QList<QVariant> &);
@
Use this if there is no other option :)
(You will still need a this reference I think, haven't tried this out!)
readAll() is not for checking the validity of the stream, it's for taking out (or consuming) all the data from input. that's why you have to store the returned data to a variable.
if you are trying to process the text line by line, probably readLine() is what you want:
http://doc.qt.nokia.com/latest/qtextstream.html#readLine
use it in a loop with proper end of data checking.
[quote author="Denis Kormalev" date="1306693935"]Hm, strange bug with bolding all text. And nothing wrong in first post. Marius, do you see?[/quote]
Strange indeed, thanks for reporting Denis.
That processImage method gets called from the right thread (in the example, the GUI thread, which is where the RenderThread object is living), so it's safe to use that way.
[quote author="Luca" date="1289835800"]Using QTcpSocket in a different thread require to pass the socket descriptor to the thread and construct the QTcpSocket in the QThread subclass as shown in the "threaded fortune server example":http://doc.qt.nokia.com/latest/network-threadedfortuneserver.html
[/quote]
BTW, I asked and I've been told that the docs (and the example) are wrong about that point:
[quote]Note: The returned QTcpSocket object cannot be used from another thread. If you want to use an incoming connection from another thread, you need to override incomingConnection().[/quote]
[quote author="2beers" date="1306683337"]Hi everyone. Can I have multipart POST requests using QNetworkAccessManager ?? I read somewhere that this might be available only in qt 4.8? is that true?
Thanks[/quote]
Yes. 4.8 will introduce the QHttpMultiPart and the QHttpPart classes, which you can use to build mime/multipart HTTP requests. Overloads for QNetworkAccessManager::post and ::put (which take a QHttpMultiPart) will be introduced as well. In the meanwhile, you can do multipart requests, but you have handle everything by hand (or by using a 3rd party library).
You can add that tag yourself. Simply edit your first message, and modify the subject line. I've done it for you this time, but next time, please do that yourself. Glad you got your issue solved!