Commit f1f672fc authored by Àlex Fiestas's avatar Àlex Fiestas

Use a global QTextStream

It seems to be the easier way of sharing one.
parent 2f5c5db7
......@@ -24,6 +24,7 @@
#include <QtCore/QCommandLineParser>
#include <QTextStream>
static QTextStream sOut(stdout);
int main(int argc, char **argv)
{
qputenv("SOLID_POWER_BACKEND", "FREE_DESKTOP");
......@@ -43,7 +44,6 @@ int main(int argc, char **argv)
if (parser.isSet(commands))
{
QTextStream sOut(stdout);
sOut << endl << QCoreApplication::translate("solid-hardware", "Syntax:") << endl << endl;
sOut << " solid-power show" << endl;
......
......@@ -30,9 +30,10 @@
using namespace Solid;
using namespace std;
static QTextStream sCout(stdout);
SolidPower::SolidPower(QObject* parent) : QObject(parent)
{
mCout = new QTextStream(stdout);
}
void SolidPower::show()
......@@ -42,6 +43,5 @@ void SolidPower::show()
QString status = job->isPlugged() ? "yes" : "no";
QTextStream sOut(stdout);
sOut << "is AC plugged:\t" << status << endl;
sCout << "is AC plugged:\t" << status << endl;
}
\ No newline at end of file
......@@ -31,8 +31,6 @@ public:
explicit SolidPower(QObject *parent = 0);
void show();
QTextStream *mCout;
};
#endif //SOLID_POWER_TOOL_H
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment