diff --git a/CMakeLists.txt b/CMakeLists.txt index da25406..09a95de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ include( ConfigureChecks.cmake ) ###### global compiler settings -add_definitions( -DHAVE_CONFIG_H -UTQT_NO_ASCII_CAST ) +add_definitions( -DHAVE_CONFIG_H ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" ) set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" ) diff --git a/tdesudo/tdesudo.cpp b/tdesudo/tdesudo.cpp index 957722d..c255d0f 100644 --- a/tdesudo/tdesudo.cpp +++ b/tdesudo/tdesudo.cpp @@ -134,7 +134,7 @@ TdeSudo::TdeSudo(TQWidget *parent, const char *name,const TQString& icon, const FILE *fout; char iceauthority[200]; char *host, *auth; - host = tqstrdup(dcopServer); + host = tqstrdup(dcopServer.ascii()); auth = tqstrdup(iceAuth); int tempfile; int oldumask = umask(077); @@ -150,8 +150,8 @@ TdeSudo::TdeSudo(TQWidget *parent, const char *name,const TQString& icon, const } iceauthorityFile = iceauthority; //FIXME we should change owner of iceauthority file, but don't have permissions - setenv("ICEAUTHORITY", iceauthorityFile, 1); - + setenv("ICEAUTHORITY", iceauthorityFile.local8Bit(), 1); + fout = popen("iceauth >/dev/null 2>&1", "w"); if (!fout) { kdError() << "error in tdesudo running iceauth" << endl; @@ -191,8 +191,8 @@ TdeSudo::TdeSudo(TQWidget *parent, const char *name,const TQString& icon, const TQString c = "/usr/bin/xauth -q -f " + m_tmpname + " generate " + TQString::fromLocal8Bit(disp) + " . trusted timeout 60"; blockSigChild(); // pclose uses waitpid() - - if (!(f = popen(c, "r"))) { + + if (!(f = popen(c.local8Bit(), "r"))) { kdWarning() << k_lineinfo << "Cannot run: " << c << "\n"; unblockSigChild(); return; @@ -251,7 +251,7 @@ TdeSudo::TdeSudo(TQWidget *parent, const char *name,const TQString& icon, const else if (priority) { TQString n = args->getOption("p"); - int intn = atoi(n); + int intn = atoi(n.ascii()); intn = (intn * 40 / 100) - (20 + 0.5); TQString strn; @@ -334,7 +334,7 @@ void TdeSudo::receivedOut(TDEProcess*, char*buffer, int buflen) pcTmp[buflen]='\0'; TQString strOut(pcTmp); - std::cout << strOut << std::endl; + std::cout << strOut.local8Bit() << std::endl; static int badpass = 0;