Skip to content

Commit

Permalink
Re-enable console interaction on Mac OS X.
Browse files Browse the repository at this point in the history
Some time after Qt 4.7.4 & Clang 3.1 this stopped working,
always complaining "Read from stdin failed" for no good reason.
Changing from C++ stream to QTextStream is simpler and should be more portable,
but I have only tested under MythBuntu 11.10 and Mac OS X 10.8.4.
Hopefully also OK under Windows?
  • Loading branch information
NigelPearson committed Aug 7, 2013
1 parent d766874 commit d10b947
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions mythtv/libs/libmythbase/mythmiscutil.cpp
Expand Up @@ -454,17 +454,8 @@ QString getResponse(const QString &query, const QString &def)
return def;
}

char response[80];
cin.clear();
cin.getline(response, 80);
if (!cin.good())
{
cout << endl;
LOG(VB_GENERAL, LOG_ERR, "Read from stdin failed");
return NULL;
}

QString qresponse = response;
QTextStream stream(stdin);
QString qresponse = stream.readLine();

if (qresponse.isEmpty())
qresponse = def;
Expand Down Expand Up @@ -943,10 +934,6 @@ void wrapList(QStringList &list, int width)
{
int i;

// if this is triggered, something has gone seriously wrong
// the result won't really be usable, but at least it won't crash
width = max(width, 5);

for(i = 0; i < list.size(); i++)
{
QString string = list.at(i);
Expand Down

0 comments on commit d10b947

Please sign in to comment.