Added controlled conversions to char* instead of automatic ascii conversions.

The definition of -UTQT_NO_ASCII_CAST is no longer needed.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 5adfcf05ce)
r14.0.x
Slávek Banko 6 years ago
parent c67c32f4fd
commit e130096415
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -58,7 +58,7 @@ include( ConfigureChecks.cmake )
###### global compiler settings
add_definitions( -DHAVE_CONFIG_H -UQT_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" )

@ -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,7 +150,7 @@ 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) {
@ -192,7 +192,7 @@ TdeSudo::TdeSudo(TQWidget *parent, const char *name,const TQString& icon, const
+ 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;

Loading…
Cancel
Save