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:
#include <Q3CString>
#include <ktoolinvocation.h>
#include <kio/job.h>
#include <kcmdlineargs.h>
#include <kpropertiesdialog.h>
@ -308,7 +309,7 @@ bool clientApp::createNewWindow(const KURL & url, bool newTab, bool tempFile, co
clientApp app;
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( error() ), &app, SLOT( delayedQuit() ));
app.exec();
@ -390,7 +391,7 @@ bool clientApp::openProfile( const QString & profileName, const QString & url, c
if( appId.isEmpty())
{
QString error;
if ( KApplication::startServiceByDesktopPath( QLatin1String("konqueror.desktop"),
if ( KToolInvocation::startServiceByDesktopPath( QLatin1String("konqueror.desktop"),
QLatin1String("--silent"), &error, &appId, NULL, startup_id_str ) > 0 )
{
kdError() << "Couldn't start konqueror from konqueror.desktop: " << error << endl;
@ -525,7 +526,7 @@ bool clientApp::doIt()
}
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( error() ), &app, SLOT( delayedQuit() ));
app.exec();

View file

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

View file

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

View file

@ -36,7 +36,7 @@
#include <kstandarddirs.h>
#include <kwin.h>
#include <kprotocolinfo.h>
#include <kurldrag.h>
#include <k3urldrag.h>
#include <kstartupinfo.h>
#include "konq_misc.h"
@ -253,7 +253,7 @@ void KonqDraggableLabel::mouseMoveEvent( QMouseEvent * ev )
{
KURL::List lst;
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->dragCopy();
}
@ -267,14 +267,14 @@ void KonqDraggableLabel::mouseReleaseEvent( QMouseEvent * )
void KonqDraggableLabel::dragEnterEvent( QDragEnterEvent *ev )
{
if ( KURLDrag::canDecode( ev ) )
if ( K3URLDrag::canDecode( ev ) )
ev->acceptAction();
}
void KonqDraggableLabel::dropEvent( QDropEvent* ev )
{
_savedLst.clear();
if ( KURLDrag::decode( ev, _savedLst ) ) {
if ( K3URLDrag::decode( ev, _savedLst ) ) {
QTimer::singleShot(0, this, SLOT(delayedOpenURL()));
}
}

View file

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

View file

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

View file

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

View file

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

View file

@ -23,7 +23,8 @@
#include <kio/paste.h>
#include <konq_operations.h>
#include <kprotocolinfo.h>
#include <kurldrag.h>
#include <k3urldrag.h>
#include <q3cstring.h>
#include <kmimetype.h>
#include <qapplication.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
// a desktop link, not to move/copy/link - except for .desktop files :-}
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();
for ( ; it != lst.end() ; it++ )
@ -169,7 +170,7 @@ void KonqSidebarTreeTopLevelItem::paste()
else
destURL = m_externalURL;
KIO::pasteClipboard( destURL, move );
KIO::pasteClipboard( destURL, 0L,move );
}
void KonqSidebarTreeTopLevelItem::rename()
@ -197,7 +198,7 @@ void KonqSidebarTreeTopLevelItem::rename( const QString & name )
// Notify about the change
KURL::List lst;
lst.append(url);
KDirNotify_stub allDirNotify("*", "KDirNotify*");
KDirNotify_stub allDirNotify(Q3CString("*"), Q3CString("KDirNotify*"));
allDirNotify.FilesChanged( lst );
}

View file

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