summaryrefslogtreecommitdiffstats
path: root/kppp/ppplog.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
commit47c8a359c5276062c4bc17f0e82410f29081b502 (patch)
tree2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kppp/ppplog.cpp
parent6f82532777a35e0e60bbd2b290b2e93e646f349b (diff)
downloadtdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz
tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kppp/ppplog.cpp')
-rw-r--r--kppp/ppplog.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/kppp/ppplog.cpp b/kppp/ppplog.cpp
index f759377a..96ccaa34 100644
--- a/kppp/ppplog.cpp
+++ b/kppp/ppplog.cpp
@@ -27,9 +27,9 @@
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <qlabel.h>
-#include <qdir.h>
-#include <qpushbutton.h>
+#include <tqlabel.h>
+#include <tqdir.h>
+#include <tqpushbutton.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -37,10 +37,10 @@
#include <unistd.h>
#include <sys/stat.h>
-#include <qdialog.h>
-#include <qregexp.h>
-#include <qmultilineedit.h>
-#include <qlayout.h>
+#include <tqdialog.h>
+#include <tqregexp.h>
+#include <tqmultilineedit.h>
+#include <tqlayout.h>
#include <kbuttonbox.h>
#include <kmessagebox.h>
@@ -50,7 +50,7 @@
#include <klocale.h>
-int PPPL_MakeLog(QStringList &list) {
+int PPPL_MakeLog(TQStringList &list) {
int pid = -1, newpid;
char buffer[1024], *p;
const char *pidp;
@@ -101,9 +101,9 @@ int PPPL_MakeLog(QStringList &list) {
"password=\"",
0};
- for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
+ for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it )
{
- QCString tmp = (*it).local8Bit();
+ TQCString tmp = (*it).local8Bit();
for(int j = 0; keyword[j] != 0; j++) {
char *p;
@@ -120,8 +120,8 @@ int PPPL_MakeLog(QStringList &list) {
}
-void PPPL_AnalyseLog(QStringList &list, QStringList &result) {
- QString msg;
+void PPPL_AnalyseLog(TQStringList &list, TQStringList &result) {
+ TQString msg;
const char *rmsg = "Remote message: ";
result.clear();
@@ -160,13 +160,13 @@ void PPPL_AnalyseLog(QStringList &list, QStringList &result) {
// scan the log for keywords and try to offer any help
- for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
+ for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it )
{
// look for remote message
int pos = (*it).find(rmsg);
if (pos != -1)
{
- QString str = (*it);
+ TQString str = (*it);
str.remove(0, pos + strlen(rmsg));
if(!str.isEmpty()) {
msg = i18n("Notice that the remote system has sent the following"
@@ -178,8 +178,8 @@ void PPPL_AnalyseLog(QStringList &list, QStringList &result) {
// check in the hint database
for(uint k = 0; hints[k].regexp != 0; k++) {
- QRegExp rx(hints[k].regexp);
- QString l(*it);
+ TQRegExp rx(hints[k].regexp);
+ TQString l(*it);
if(l.contains(rx)) {
result.append(i18n(hints[k].answer));
break;
@@ -196,15 +196,15 @@ void PPPL_AnalyseLog(QStringList &list, QStringList &result) {
void PPPL_ShowLog() {
- QStringList sl, result;
+ TQStringList sl, result;
PPPL_MakeLog(sl);
bool foundConnect = false;
bool foundLCP = gpppdata.getPPPDebug();
- QString lcp = QString::fromLatin1("[LCP");
- QString conn = QString::fromLatin1("Connect:");
- QStringList::ConstIterator it = sl.begin();
+ TQString lcp = TQString::fromLatin1("[LCP");
+ TQString conn = TQString::fromLatin1("Connect:");
+ TQStringList::ConstIterator it = sl.begin();
for( ; it != sl.end(); it++) {
if((*it).find(lcp) >= 0) {
foundLCP = true;
@@ -219,7 +219,7 @@ void PPPL_ShowLog() {
"that pppd was started without the \"debug\" option.\n"
"Without this option it's difficult to find out PPP "
"problems, so you should turn on the debug option.\n"
- "Shall I turn it on now?"), QString::null, i18n("Restart pppd"), i18n("Do Not Restart"));
+ "Shall I turn it on now?"), TQString::null, i18n("Restart pppd"), i18n("Do Not Restart"));
if(result == KMessageBox::Yes) {
gpppdata.setPPPDebug(TRUE);
@@ -236,19 +236,19 @@ void PPPL_ShowLog() {
PPPL_AnalyseLog(sl, result);
- QDialog *dlg = new QDialog(0, "", TRUE);
+ TQDialog *dlg = new TQDialog(0, "", TRUE);
dlg->setCaption(i18n("PPP Log"));
- QVBoxLayout *tl = new QVBoxLayout(dlg, 10, 10);
- QMultiLineEdit *edit = new QMultiLineEdit(dlg);
+ TQVBoxLayout *tl = new TQVBoxLayout(dlg, 10, 10);
+ TQMultiLineEdit *edit = new TQMultiLineEdit(dlg);
edit->setReadOnly(TRUE);
- QLabel *label = new QLabel(i18n("kppp's diagnosis (just guessing):"), dlg);
- QMultiLineEdit *diagnosis = new QMultiLineEdit(dlg);
+ TQLabel *label = new TQLabel(i18n("kppp's diagnosis (just guessing):"), dlg);
+ TQMultiLineEdit *diagnosis = new TQMultiLineEdit(dlg);
diagnosis->setReadOnly(TRUE);
KButtonBox *bbox = new KButtonBox(dlg);
bbox->addStretch(1);
- QPushButton *write = bbox->addButton(i18n("Write to File"));
- QPushButton *close = bbox->addButton(KStdGuiItem::close());
+ TQPushButton *write = bbox->addButton(i18n("Write to File"));
+ TQPushButton *close = bbox->addButton(KStdGuiItem::close());
bbox->layout();
edit->setMinimumSize(600, 250);
label->setMinimumSize(600, 15);
@@ -265,23 +265,23 @@ void PPPL_ShowLog() {
for(uint i = 0; i < result.count(); i++)
diagnosis->append(*result.at(i));
- dlg->connect(close, SIGNAL(clicked()),
- dlg, SLOT(reject()));
- dlg->connect(write, SIGNAL(clicked()),
- dlg, SLOT(accept()));
+ dlg->connect(close, TQT_SIGNAL(clicked()),
+ dlg, TQT_SLOT(reject()));
+ dlg->connect(write, TQT_SIGNAL(clicked()),
+ dlg, TQT_SLOT(accept()));
if(dlg->exec()) {
- QDir d = QDir::home();
- QString s = d.absPath() + "/PPP-logfile";
+ TQDir d = TQDir::home();
+ TQString s = d.absPath() + "/PPP-logfile";
int old_umask = umask(0077);
- FILE *f = fopen(QFile::encodeName(s), "w");
+ FILE *f = fopen(TQFile::encodeName(s), "w");
for(uint i = 0; i < sl.count(); i++)
fprintf(f, "%s\n", (*sl.at(i)).local8Bit().data());
fclose(f);
umask(old_umask);
- QString msg = i18n("The PPP log has been saved\nas \"%1\"!\n\nIf you want to send a bug report, or have\nproblems connecting to the Internet, please\nattach this file. It will help the maintainers\nto find the bug and to improve KPPP").arg(s);
+ TQString msg = i18n("The PPP log has been saved\nas \"%1\"!\n\nIf you want to send a bug report, or have\nproblems connecting to the Internet, please\nattach this file. It will help the maintainers\nto find the bug and to improve KPPP").arg(s);
KMessageBox::information(0, msg);
}
delete dlg;