summaryrefslogtreecommitdiffstats
path: root/kio/kfile/tests
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
commitffe8a83e053396df448e9413828527613ca3bd46 (patch)
treea73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kio/kfile/tests
parent682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff)
downloadtdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz
tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kio/kfile/tests')
-rw-r--r--kio/kfile/tests/kdirselectdialogtest.cpp4
-rw-r--r--kio/kfile/tests/kfdtest.cpp16
-rw-r--r--kio/kfile/tests/kfdtest.h6
-rw-r--r--kio/kfile/tests/kfiletreeviewtest.cpp44
-rw-r--r--kio/kfile/tests/kfiletreeviewtest.h2
-rw-r--r--kio/kfile/tests/kfstest.cpp74
-rw-r--r--kio/kfile/tests/kopenwithtest.cpp8
-rw-r--r--kio/kfile/tests/kurlrequestertest.cpp2
8 files changed, 78 insertions, 78 deletions
diff --git a/kio/kfile/tests/kdirselectdialogtest.cpp b/kio/kfile/tests/kdirselectdialogtest.cpp
index e2eb52f1b..47fcd02ca 100644
--- a/kio/kfile/tests/kdirselectdialogtest.cpp
+++ b/kio/kfile/tests/kdirselectdialogtest.cpp
@@ -7,10 +7,10 @@ int main( int argc, char **argv )
{
KApplication app(argc, argv, "kdirselectdialogtest");
- KURL u = KDirSelectDialog::selectDirectory( (argc >= 1) ? argv[1] : QString::null );
+ KURL u = KDirSelectDialog::selectDirectory( (argc >= 1) ? argv[1] : TQString::null );
if ( u.isValid() )
KMessageBox::information( 0L,
- QString::fromLatin1("You selected the url: %1")
+ TQString::fromLatin1("You selected the url: %1")
.arg( u.prettyURL() ), "Selected URL" );
return 0;
diff --git a/kio/kfile/tests/kfdtest.cpp b/kio/kfile/tests/kfdtest.cpp
index d9341a7ae..25e2da949 100644
--- a/kio/kfile/tests/kfdtest.cpp
+++ b/kio/kfile/tests/kfdtest.cpp
@@ -1,31 +1,31 @@
#include "kfdtest.h"
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <kfiledialog.h>
#include <kapplication.h>
#include <kmessagebox.h>
-#include <qtimer.h>
+#include <tqtimer.h>
-KFDTest::KFDTest( const QString& startDir, QObject *parent, const char *name )
- : QObject( parent, name ),
+KFDTest::KFDTest( const TQString& startDir, TQObject *parent, const char *name )
+ : TQObject( parent, name ),
m_startDir( startDir )
{
- QTimer::singleShot( 1000, this, SLOT( doit() ));
+ TQTimer::singleShot( 1000, this, TQT_SLOT( doit() ));
}
void KFDTest::doit()
{
- KFileDialog *dlg = new KFileDialog( m_startDir, QString::null, 0L,
+ KFileDialog *dlg = new KFileDialog( m_startDir, TQString::null, 0L,
"file dialog", true );
dlg->setMode( KFile::File);
dlg->setOperationMode( KFileDialog::Saving );
- QStringList filter;
+ TQStringList filter;
filter << "all/allfiles" << "text/plain";
dlg->setMimeFilter( filter, "all/allfiles" );
if ( dlg->exec() == KDialog::Accepted )
{
- KMessageBox::information(0, QString::fromLatin1("You selected the file: %1").arg( dlg->selectedURL().prettyURL() ));
+ KMessageBox::information(0, TQString::fromLatin1("You selected the file: %1").arg( dlg->selectedURL().prettyURL() ));
}
// qApp->quit();
diff --git a/kio/kfile/tests/kfdtest.h b/kio/kfile/tests/kfdtest.h
index 0743bb96c..3f980bc94 100644
--- a/kio/kfile/tests/kfdtest.h
+++ b/kio/kfile/tests/kfdtest.h
@@ -8,20 +8,20 @@
#ifndef KFDTEST_H
#define KFDTEST_H
-#include <qobject.h>
+#include <tqobject.h>
class KFDTest : public QObject
{
Q_OBJECT
public:
- KFDTest( const QString& startDir, QObject *parent = 0, const char *name = 0);
+ KFDTest( const TQString& startDir, TQObject *parent = 0, const char *name = 0);
public slots:
void doit();
private:
- QString m_startDir;
+ TQString m_startDir;
};
diff --git a/kio/kfile/tests/kfiletreeviewtest.cpp b/kio/kfile/tests/kfiletreeviewtest.cpp
index 6a4ea719f..5c520dd5d 100644
--- a/kio/kfile/tests/kfiletreeviewtest.cpp
+++ b/kio/kfile/tests/kfiletreeviewtest.cpp
@@ -17,7 +17,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <qdir.h>
+#include <tqdir.h>
#include <kglobal.h>
#include <kiconloader.h>
@@ -45,30 +45,30 @@ testFrame::testFrame():KMainWindow(0,"Test FileTreeView"),
/* Connect to see the status bar */
KStatusBar* sta = statusBar();
- connect( treeView, SIGNAL( onItem( const QString& )),
- sta, SLOT( message( const QString& )));
+ connect( treeView, TQT_SIGNAL( onItem( const TQString& )),
+ sta, TQT_SLOT( message( const TQString& )));
- connect( treeView, SIGNAL( dropped( QWidget*, QDropEvent*, KURL::List& )),
- this, SLOT( urlsDropped( QWidget*, QDropEvent*, KURL::List& )));
+ connect( treeView, TQT_SIGNAL( dropped( TQWidget*, TQDropEvent*, KURL::List& )),
+ this, TQT_SLOT( urlsDropped( TQWidget*, TQDropEvent*, KURL::List& )));
- connect( treeView, SIGNAL( dropped( KURL::List&, KURL& )), this,
- SLOT( copyURLs( KURL::List&, KURL& )));
+ connect( treeView, TQT_SIGNAL( dropped( KURL::List&, KURL& )), this,
+ TQT_SLOT( copyURLs( KURL::List&, KURL& )));
treeView->addColumn( "File" );
treeView->addColumn( "ChildCount" );
setCentralWidget( treeView );
resize( 600, 400 );
- showPath( KURL::fromPathOrURL( QDir::homeDirPath() ));
+ showPath( KURL::fromPathOrURL( TQDir::homeDirPath() ));
}
void testFrame::showPath( const KURL &url )
{
- QString fname = "TestBranch"; // url.fileName ();
+ TQString fname = "TestBranch"; // url.fileName ();
/* try a user icon */
KIconLoader *loader = KGlobal::iconLoader();
- QPixmap pix = loader->loadIcon( "contents2", KIcon::Small );
- QPixmap pixOpen = loader->loadIcon( "contents", KIcon::Small );
+ TQPixmap pix = loader->loadIcon( "contents2", KIcon::Small );
+ TQPixmap pixOpen = loader->loadIcon( "contents", KIcon::Small );
KFileTreeBranch *nb = treeView->addBranch( url, fname, pix );
@@ -77,10 +77,10 @@ void testFrame::showPath( const KURL &url )
if( dirOnlyMode ) treeView->setDirOnlyMode( nb, true );
nb->setOpenPixmap( pixOpen );
- connect( nb, SIGNAL(populateFinished(KFileTreeViewItem*)),
- this, SLOT(slotPopulateFinished(KFileTreeViewItem*)));
- connect( nb, SIGNAL( directoryChildCount( KFileTreeViewItem *, int )),
- this, SLOT( slotSetChildCount( KFileTreeViewItem*, int )));
+ connect( nb, TQT_SIGNAL(populateFinished(KFileTreeViewItem*)),
+ this, TQT_SLOT(slotPopulateFinished(KFileTreeViewItem*)));
+ connect( nb, TQT_SIGNAL( directoryChildCount( KFileTreeViewItem *, int )),
+ this, TQT_SLOT( slotSetChildCount( KFileTreeViewItem*, int )));
// nb->setChildRecurse(false );
nb->setOpen(true);
@@ -89,7 +89,7 @@ void testFrame::showPath( const KURL &url )
}
-void testFrame::urlsDropped( QWidget* , QDropEvent* , KURL::List& list )
+void testFrame::urlsDropped( TQWidget* , TQDropEvent* , KURL::List& list )
{
KURL::List::ConstIterator it = list.begin();
for ( ; it != list.end(); ++it ) {
@@ -117,7 +117,7 @@ void testFrame::slotPopulateFinished(KFileTreeViewItem *item )
kdDebug() << "setting column 2 of treeview with count " << cc << endl;
- item->setText( 1, QString::number( cc ));
+ item->setText( 1, TQString::number( cc ));
#endif
}
else
@@ -129,16 +129,16 @@ void testFrame::slotPopulateFinished(KFileTreeViewItem *item )
void testFrame::slotSetChildCount( KFileTreeViewItem *item, int c )
{
if( item )
- item->setText(1, QString::number( c ));
+ item->setText(1, TQString::number( c ));
}
int main(int argc, char **argv)
{
KApplication a(argc, argv, "kfiletreeviewtest");
- QString name1;
- QStringList names;
+ TQString name1;
+ TQStringList names;
- QString argv1;
+ TQString argv1;
testFrame *tf;
tf = new testFrame();
@@ -148,7 +148,7 @@ int main(int argc, char **argv)
{
for( int i = 1; i < argc; i++ )
{
- argv1 = QString::fromLatin1(argv[i]);
+ argv1 = TQString::fromLatin1(argv[i]);
kdDebug() << "Opening " << argv1 << endl;
if( argv1 == "-d" )
tf->setDirOnly();
diff --git a/kio/kfile/tests/kfiletreeviewtest.h b/kio/kfile/tests/kfiletreeviewtest.h
index 1286e1be2..4ae791ce5 100644
--- a/kio/kfile/tests/kfiletreeviewtest.h
+++ b/kio/kfile/tests/kfiletreeviewtest.h
@@ -31,7 +31,7 @@ public slots:
void slotPopulateFinished(KFileTreeViewItem *);
void slotSetChildCount( KFileTreeViewItem *item, int c );
- void urlsDropped( QWidget*, QDropEvent*, KURL::List& );
+ void urlsDropped( TQWidget*, TQDropEvent*, KURL::List& );
void copyURLs( KURL::List& list, KURL& to );
private:
KFileTreeView *treeView;
diff --git a/kio/kfile/tests/kfstest.cpp b/kio/kfile/tests/kfstest.cpp
index 16d74cb0c..b84cbc967 100644
--- a/kio/kfile/tests/kfstest.cpp
+++ b/kio/kfile/tests/kfstest.cpp
@@ -23,10 +23,10 @@
#include <unistd.h>
#include <stdlib.h>
#include <sys/stat.h>
-#include <qdir.h>
-#include <qlayout.h>
-#include <qstringlist.h>
-#include <qwidget.h>
+#include <tqdir.h>
+#include <tqlayout.h>
+#include <tqstringlist.h>
+#include <tqwidget.h>
#include <kfiledialog.h>
#include <kfileiconview.h>
@@ -45,17 +45,17 @@
int main(int argc, char **argv)
{
KApplication a(argc, argv, "kfstest");
- QString name1;
- QStringList names;
+ TQString name1;
+ TQStringList names;
- QString argv1;
- QString startDir;
+ TQString argv1;
+ TQString startDir;
if (argc > 1)
- argv1 = QString::fromLatin1(argv[1]);
+ argv1 = TQString::fromLatin1(argv[1]);
if ( argc > 2 )
- startDir = QString::fromLatin1( argv[2]);
+ startDir = TQString::fromLatin1( argv[2]);
- if (argv1 == QString::fromLatin1("diroperator")) {
+ if (argv1 == TQString::fromLatin1("diroperator")) {
KDirOperator *op = new KDirOperator(startDir, 0, "operator");
op->setViewConfig( KGlobal::config(), "TestGroup" );
op->setView(KFile::Simple);
@@ -64,73 +64,73 @@ int main(int argc, char **argv)
a.exec();
}
- else if (argv1 == QString::fromLatin1("justone")) {
- QString name = KFileDialog::getOpenFileName(startDir);
+ else if (argv1 == TQString::fromLatin1("justone")) {
+ TQString name = KFileDialog::getOpenFileName(startDir);
qDebug("filename=%s",name.latin1());
}
- else if (argv1 == QString::fromLatin1("existingURL")) {
+ else if (argv1 == TQString::fromLatin1("existingURL")) {
KURL url = KFileDialog::getExistingURL();
qDebug("URL=%s",url.url().latin1());
name1 = url.url();
}
- else if (argv1 == QString::fromLatin1("preview")) {
+ else if (argv1 == TQString::fromLatin1("preview")) {
KURL u = KFileDialog::getImageOpenURL();
qDebug("filename=%s", u.url().latin1());
}
- else if (argv1 == QString::fromLatin1("preselect")) {
- names = KFileDialog::getOpenFileNames(QString::fromLatin1("/etc/passwd"));
- QStringList::Iterator it = names.begin();
+ else if (argv1 == TQString::fromLatin1("preselect")) {
+ names = KFileDialog::getOpenFileNames(TQString::fromLatin1("/etc/passwd"));
+ TQStringList::Iterator it = names.begin();
while ( it != names.end() ) {
qDebug("selected file: %s", (*it).latin1());
++it;
}
}
- else if (argv1 == QString::fromLatin1("dirs"))
+ else if (argv1 == TQString::fromLatin1("dirs"))
name1 = KFileDialog::getExistingDirectory();
- else if (argv1 == QString::fromLatin1("heap")) {
- KFileDialog *dlg = new KFileDialog( startDir, QString::null, 0L,
+ else if (argv1 == TQString::fromLatin1("heap")) {
+ KFileDialog *dlg = new KFileDialog( startDir, TQString::null, 0L,
"file dialog", true );
dlg->setMode( KFile::File);
dlg->setOperationMode( KFileDialog::Saving );
- QStringList filter;
+ TQStringList filter;
filter << "all/allfiles" << "text/plain";
dlg->setMimeFilter( filter, "all/allfiles" );
KURLBar *urlBar = dlg->speedBar();
if ( urlBar )
{
urlBar->insertDynamicItem( KURL("ftp://ftp.kde.org"),
- QString::fromLatin1("KDE FTP Server") );
+ TQString::fromLatin1("KDE FTP Server") );
}
if ( dlg->exec() == KDialog::Accepted )
name1 = dlg->selectedURL().url();
}
- else if ( argv1 == QString::fromLatin1("eventloop") )
+ else if ( argv1 == TQString::fromLatin1("eventloop") )
{
KFDTest *test = new KFDTest( startDir );
return a.exec();
}
- else if (argv1 == QString::fromLatin1("save")) {
+ else if (argv1 == TQString::fromLatin1("save")) {
KURL u = KFileDialog::getSaveURL();
-// QString(QDir::homeDirPath() + QString::fromLatin1("/testfile")),
-// QString::null, 0L);
+// TQString(TQDir::homeDirPath() + TQString::fromLatin1("/testfile")),
+// TQString::null, 0L);
name1 = u.url();
}
- else if (argv1 == QString::fromLatin1("icon")) {
+ else if (argv1 == TQString::fromLatin1("icon")) {
KIconDialog dlg;
- QString icon = dlg.selectIcon();
+ TQString icon = dlg.selectIcon();
kdDebug() << icon << endl;
}
-// else if ( argv1 == QString::fromLatin1("dirselect") ) {
+// else if ( argv1 == TQString::fromLatin1("dirselect") ) {
// KURL url;
// url.setPath( "/" );
// KURL selected = KDirSelectDialog::selectDirectory( url );
@@ -140,7 +140,7 @@ int main(int argc, char **argv)
else {
KFileDialog dlg(startDir,
- QString::fromLatin1("*|All Files\n"
+ TQString::fromLatin1("*|All Files\n"
"*.lo *.o *.la|All libtool Files"),
0, 0, true);
// dlg.setFilter( "*.kdevelop" );
@@ -148,14 +148,14 @@ int main(int argc, char **argv)
KFile::Directory |
KFile::ExistingOnly |
KFile::LocalOnly) );
-// QStringList filter;
+// TQStringList filter;
// filter << "text/plain" << "text/html" << "image/png";
// dlg.setMimeFilter( filter );
// KMimeType::List types;
// types.append( KMimeType::mimeType( "text/plain" ) );
// types.append( KMimeType::mimeType( "text/html" ) );
// dlg.setFilterMimeType( "Filetypes:", types, types.first() );
- if ( dlg.exec() == QDialog::Accepted ) {
+ if ( dlg.exec() == TQDialog::Accepted ) {
KURL::List list = dlg.selectedURLs();
KURL::List::ConstIterator it = list.begin();
qDebug("*** selectedURLs(): ");
@@ -167,8 +167,8 @@ int main(int argc, char **argv)
qDebug("*** selectedFile: %s", dlg.selectedFile().latin1());
qDebug("*** selectedURL: %s", dlg.selectedURL().url().latin1());
qDebug("*** selectedFiles: ");
- QStringList l = dlg.selectedFiles();
- QStringList::Iterator it2 = l.begin();
+ TQStringList l = dlg.selectedFiles();
+ TQStringList::Iterator it2 = l.begin();
while ( it2 != l.end() ) {
qDebug(" -> %s", (*it2).latin1());
++it2;
@@ -177,7 +177,7 @@ int main(int argc, char **argv)
}
if (!(name1.isNull()))
- KMessageBox::information(0, QString::fromLatin1("You selected the file " ) + name1,
- QString::fromLatin1("Your Choice"));
+ KMessageBox::information(0, TQString::fromLatin1("You selected the file " ) + name1,
+ TQString::fromLatin1("Your Choice"));
return 0;
}
diff --git a/kio/kfile/tests/kopenwithtest.cpp b/kio/kfile/tests/kopenwithtest.cpp
index 96e18bcc2..ea348a94c 100644
--- a/kio/kfile/tests/kopenwithtest.cpp
+++ b/kio/kfile/tests/kopenwithtest.cpp
@@ -19,9 +19,9 @@
*/
#include <kapplication.h>
-#include <qwidget.h>
-#include <qstringlist.h>
-#include <qdir.h>
+#include <tqwidget.h>
+#include <tqstringlist.h>
+#include <tqdir.h>
#include <kopenwith.h>
#include <kurl.h>
#include <kdebug.h>
@@ -53,7 +53,7 @@ int main(int argc, char **argv)
delete dlg;
// Test with a mimetype
- QString mimetype = "text/plain";
+ TQString mimetype = "text/plain";
dlg = new KOpenWithDlg( mimetype, "kedit", 0);
if(dlg->exec()) {
kdDebug() << "Dialog ended successfully\ntext: " << dlg->text() << endl;
diff --git a/kio/kfile/tests/kurlrequestertest.cpp b/kio/kfile/tests/kurlrequestertest.cpp
index 5601f4922..9248eec5d 100644
--- a/kio/kfile/tests/kurlrequestertest.cpp
+++ b/kio/kfile/tests/kurlrequestertest.cpp
@@ -10,7 +10,7 @@ int main( int argc, char **argv )
qDebug( "Selected url: %s", url.url().latin1());
KURLRequester *req = new KURLRequester();
- KEditListBox *el = new KEditListBox( QString::fromLatin1("Test"), req->customEditor() );
+ KEditListBox *el = new KEditListBox( TQString::fromLatin1("Test"), req->customEditor() );
el->show();
return app.exec();
}