First step to port konqueror

svn path=/trunk/KDE/kdebase/konqueror/; revision=467090
This commit is contained in:
Laurent Montel 2005-10-04 09:40:02 +00:00
parent 807932b3bc
commit 91db9314cd
10 changed files with 29 additions and 26 deletions

View file

@ -27,6 +27,7 @@
//Added by qt3to4: //Added by qt3to4:
#include <Q3CString> #include <Q3CString>
#include <ktoolinvocation.h>
#include <kio/job.h> #include <kio/job.h>
#include <kcmdlineargs.h> #include <kcmdlineargs.h>
#include <kpropertiesdialog.h> #include <kpropertiesdialog.h>
@ -308,7 +309,7 @@ bool clientApp::createNewWindow(const KURL & url, bool newTab, bool tempFile, co
clientApp app; clientApp app;
KStartupInfo::appStarted(); KStartupInfo::appStarted();
KRun * run = new KRun( url ); // TODO pass tempFile [needs support in the KRun ctor] KRun * run = new KRun( url,0L ); // TODO pass tempFile [needs support in the KRun ctor]
QObject::connect( run, SIGNAL( finished() ), &app, SLOT( delayedQuit() )); QObject::connect( run, SIGNAL( finished() ), &app, SLOT( delayedQuit() ));
QObject::connect( run, SIGNAL( error() ), &app, SLOT( delayedQuit() )); QObject::connect( run, SIGNAL( error() ), &app, SLOT( delayedQuit() ));
app.exec(); app.exec();
@ -390,7 +391,7 @@ bool clientApp::openProfile( const QString & profileName, const QString & url, c
if( appId.isEmpty()) if( appId.isEmpty())
{ {
QString error; QString error;
if ( KApplication::startServiceByDesktopPath( QLatin1String("konqueror.desktop"), if ( KToolInvocation::startServiceByDesktopPath( QLatin1String("konqueror.desktop"),
QLatin1String("--silent"), &error, &appId, NULL, startup_id_str ) > 0 ) QLatin1String("--silent"), &error, &appId, NULL, startup_id_str ) > 0 )
{ {
kdError() << "Couldn't start konqueror from konqueror.desktop: " << error << endl; kdError() << "Couldn't start konqueror from konqueror.desktop: " << error << endl;
@ -525,7 +526,7 @@ bool clientApp::doIt()
} }
else if ( argc == 2 ) else if ( argc == 2 )
{ {
KRun * run = new KRun( args->url(1) ); KRun * run = new KRun( args->url(1), 0L);
QObject::connect( run, SIGNAL( finished() ), &app, SLOT( delayedQuit() )); QObject::connect( run, SIGNAL( finished() ), &app, SLOT( delayedQuit() ));
QObject::connect( run, SIGNAL( error() ), &app, SLOT( delayedQuit() )); QObject::connect( run, SIGNAL( error() ), &app, SLOT( delayedQuit() ));
app.exec(); app.exec();

View file

@ -33,7 +33,7 @@
#include <dcopclient.h> #include <dcopclient.h>
#include <kimageio.h> #include <kimageio.h>
#include <qfile.h> #include <qfile.h>
#include <QApplication>
#include <qwidget.h> #include <qwidget.h>
#include <QX11Info> #include <QX11Info>
@ -71,7 +71,7 @@ extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
KTempFile crashlog_file(locateLocal("tmp", "konqueror-crash-"), ".log"); KTempFile crashlog_file(locateLocal("tmp", "konqueror-crash-"), ".log");
KonqMainWindow::s_crashlog_file = crashlog_file.file(); KonqMainWindow::s_crashlog_file = crashlog_file.file();
if ( QApplication::isSessionRestored() ) if ( app.isSessionRestored() )
{ {
int n = 1; int n = 1;
while ( KonqMainWindow::canBeRestored( n ) ) while ( KonqMainWindow::canBeRestored( n ) )

View file

@ -1931,7 +1931,7 @@ void KonqMainWindow::slotConfigure()
void KonqMainWindow::slotConfigureSpellChecking() void KonqMainWindow::slotConfigureSpellChecking()
{ {
KApplication::startServiceByDesktopName("spellchecking"); KToolInvocation::startServiceByDesktopName("spellchecking");
} }
void KonqMainWindow::slotConfigureToolbars() void KonqMainWindow::slotConfigureToolbars()

View file

@ -36,7 +36,7 @@
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include <kwin.h> #include <kwin.h>
#include <kprotocolinfo.h> #include <kprotocolinfo.h>
#include <kurldrag.h> #include <k3urldrag.h>
#include <kstartupinfo.h> #include <kstartupinfo.h>
#include "konq_misc.h" #include "konq_misc.h"
@ -253,7 +253,7 @@ void KonqDraggableLabel::mouseMoveEvent( QMouseEvent * ev )
{ {
KURL::List lst; KURL::List lst;
lst.append( m_mw->currentView()->url() ); lst.append( m_mw->currentView()->url() );
Q3DragObject * drag = new KURLDrag( lst, m_mw ); Q3DragObject * drag = new K3URLDrag( lst, m_mw );
drag->setPixmap( KMimeType::pixmapForURL( lst.first(), 0, KIcon::Small ) ); drag->setPixmap( KMimeType::pixmapForURL( lst.first(), 0, KIcon::Small ) );
drag->dragCopy(); drag->dragCopy();
} }
@ -267,14 +267,14 @@ void KonqDraggableLabel::mouseReleaseEvent( QMouseEvent * )
void KonqDraggableLabel::dragEnterEvent( QDragEnterEvent *ev ) void KonqDraggableLabel::dragEnterEvent( QDragEnterEvent *ev )
{ {
if ( KURLDrag::canDecode( ev ) ) if ( K3URLDrag::canDecode( ev ) )
ev->acceptAction(); ev->acceptAction();
} }
void KonqDraggableLabel::dropEvent( QDropEvent* ev ) void KonqDraggableLabel::dropEvent( QDropEvent* ev )
{ {
_savedLst.clear(); _savedLst.clear();
if ( KURLDrag::decode( ev, _savedLst ) ) { if ( K3URLDrag::decode( ev, _savedLst ) ) {
QTimer::singleShot(0, this, SLOT(delayedOpenURL())); QTimer::singleShot(0, this, SLOT(delayedOpenURL()));
} }
} }

View file

@ -38,7 +38,7 @@
#include <assert.h> #include <assert.h>
#include <kdebug.h> #include <kdebug.h>
#include <kcursor.h> #include <kcursor.h>
#include <kurldrag.h> #include <k3urldrag.h>
#include <q3scrollview.h> #include <q3scrollview.h>
#include <qapplication.h> #include <qapplication.h>
@ -1244,10 +1244,10 @@ bool KonqView::eventFilter( QObject *obj, QEvent *e )
{ {
QDragEnterEvent *ev = static_cast<QDragEnterEvent *>( e ); QDragEnterEvent *ev = static_cast<QDragEnterEvent *>( e );
if ( KURLDrag::canDecode( ev ) ) if ( K3URLDrag::canDecode( ev ) )
{ {
KURL::List lstDragURLs; KURL::List lstDragURLs;
bool ok = KURLDrag::decode( ev, lstDragURLs ); bool ok = K3URLDrag::decode( ev, lstDragURLs );
QObjectList children = m_pPart->widget()->queryList( "QWidget" ); QObjectList children = m_pPart->widget()->queryList( "QWidget" );
@ -1263,7 +1263,7 @@ bool KonqView::eventFilter( QObject *obj, QEvent *e )
QDropEvent *ev = static_cast<QDropEvent *>( e ); QDropEvent *ev = static_cast<QDropEvent *>( e );
KURL::List lstDragURLs; KURL::List lstDragURLs;
bool ok = KURLDrag::decode( ev, lstDragURLs ); bool ok = K3URLDrag::decode( ev, lstDragURLs );
KParts::BrowserExtension *ext = browserExtension(); KParts::BrowserExtension *ext = browserExtension();
if ( ok && ext && lstDragURLs.first().isValid() ) if ( ok && ext && lstDragURLs.first().isValid() )

View file

@ -1720,7 +1720,7 @@ void KonqViewManager::slotProfileListAboutToShow()
if ( !m_pamProfiles || !m_bProfileListDirty ) if ( !m_pamProfiles || !m_bProfileListDirty )
return; return;
Q3PopupMenu *popup = m_pamProfiles->popupMenu(); KMenu *popup = m_pamProfiles->popupMenu();
popup->clear(); popup->clear();
// Fetch profiles // Fetch profiles

View file

@ -21,7 +21,7 @@
#include "kservicelistwidget.h" #include "kservicelistwidget.h"
#include <klocale.h> #include <klocale.h>
#include <Q3ValueList>
#include <q3vbox.h> #include <q3vbox.h>
#include <qlabel.h> #include <qlabel.h>

View file

@ -52,7 +52,7 @@
#include <kpropertiesdialog.h> #include <kpropertiesdialog.h>
#include <kprotocolinfo.h> #include <kprotocolinfo.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include <kurldrag.h> #include <k3urldrag.h>
#include <stdlib.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
@ -340,7 +340,7 @@ void KonqSidebarTree::contentsDropEvent( QDropEvent *ev )
{ {
// KonqOperations::doDrop( 0L, m_dirtreeDir.dir, ev, this ); // KonqOperations::doDrop( 0L, m_dirtreeDir.dir, ev, this );
KURL::List urls; KURL::List urls;
if ( KURLDrag::decode( ev, urls ) ) if ( K3URLDrag::decode( ev, urls ) )
{ {
for(KURL::List::ConstIterator it = urls.begin(); for(KURL::List::ConstIterator it = urls.begin();
it != urls.end(); ++it) it != urls.end(); ++it)
@ -912,7 +912,8 @@ void KonqSidebarTree::showToplevelContextMenu()
if (!m_collection) if (!m_collection)
{ {
m_collection = new KActionCollection( this, "bookmark actions" ); m_collection = new KActionCollection( this);
m_collection->setObjectName("bookmark actions");
(void) new KAction( i18n("&Create New Folder..."), "folder_new", 0, this, (void) new KAction( i18n("&Create New Folder..."), "folder_new", 0, this,
SLOT( slotCreateFolder() ), m_collection, "create_folder"); SLOT( slotCreateFolder() ), m_collection, "create_folder");
(void) new KAction( i18n("Delete Folder"), "editdelete", 0, this, (void) new KAction( i18n("Delete Folder"), "editdelete", 0, this,
@ -1037,8 +1038,8 @@ void KonqSidebarTree::slotCopyLocation()
{ {
if (!m_currentTopLevelItem) return; if (!m_currentTopLevelItem) return;
KURL url = m_currentTopLevelItem->externalURL(); KURL url = m_currentTopLevelItem->externalURL();
kapp->clipboard()->setData( new KURLDrag(url, 0), QClipboard::Selection ); kapp->clipboard()->setData( new K3URLDrag(url, 0), QClipboard::Selection );
kapp->clipboard()->setData( new KURLDrag(url, 0), QClipboard::Clipboard ); kapp->clipboard()->setData( new K3URLDrag(url, 0), QClipboard::Clipboard );
} }
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////

View file

@ -23,7 +23,8 @@
#include <kio/paste.h> #include <kio/paste.h>
#include <konq_operations.h> #include <konq_operations.h>
#include <kprotocolinfo.h> #include <kprotocolinfo.h>
#include <kurldrag.h> #include <k3urldrag.h>
#include <q3cstring.h>
#include <kmimetype.h> #include <kmimetype.h>
#include <qapplication.h> #include <qapplication.h>
#include <qclipboard.h> #include <qclipboard.h>
@ -68,7 +69,7 @@ void KonqSidebarTreeTopLevelItem::drop( QDropEvent * ev )
// When dropping something to "Network" or its subdirs, we want to create // When dropping something to "Network" or its subdirs, we want to create
// a desktop link, not to move/copy/link - except for .desktop files :-} // a desktop link, not to move/copy/link - except for .desktop files :-}
KURL::List lst; KURL::List lst;
if ( KURLDrag::decode( ev, lst ) && !lst.isEmpty() ) // Are they urls ? if ( K3URLDrag::decode( ev, lst ) && !lst.isEmpty() ) // Are they urls ?
{ {
KURL::List::Iterator it = lst.begin(); KURL::List::Iterator it = lst.begin();
for ( ; it != lst.end() ; it++ ) for ( ; it != lst.end() ; it++ )
@ -169,7 +170,7 @@ void KonqSidebarTreeTopLevelItem::paste()
else else
destURL = m_externalURL; destURL = m_externalURL;
KIO::pasteClipboard( destURL, move ); KIO::pasteClipboard( destURL, 0L,move );
} }
void KonqSidebarTreeTopLevelItem::rename() void KonqSidebarTreeTopLevelItem::rename()
@ -197,7 +198,7 @@ void KonqSidebarTreeTopLevelItem::rename( const QString & name )
// Notify about the change // Notify about the change
KURL::List lst; KURL::List lst;
lst.append(url); lst.append(url);
KDirNotify_stub allDirNotify("*", "KDirNotify*"); KDirNotify_stub allDirNotify(Q3CString("*"), Q3CString("KDirNotify*"));
allDirNotify.FilesChanged( lst ); allDirNotify.FilesChanged( lst );
} }

View file

@ -86,7 +86,7 @@ QWidget *KonqSideBarWebModule::getWidget() {
void KonqSideBarWebModule::setAutoReload(){ void KonqSideBarWebModule::setAutoReload(){
KDialogBase dlg(0, "", true, i18n("Set Refresh Timeout (0 disables)"), KDialogBase dlg(0, "", true, i18n("Set Refresh Timeout (0 disables)"),
KDialogBase::Ok|KDialogBase::Cancel); KDialogBase::Ok|KDialogBase::Cancel);
Q3HBox *hbox = dlg.makeHBoxMainWidget(); KHBox *hbox = dlg.makeHBoxMainWidget();
QSpinBox *mins = new QSpinBox( 0, 120, 1, hbox ); QSpinBox *mins = new QSpinBox( 0, 120, 1, hbox );
mins->setSuffix( i18n(" minutes") ); mins->setSuffix( i18n(" minutes") );