Commit 83255587 authored by Pascal Létourneau's avatar Pascal Létourneau
Browse files

Porting

svn path=/trunk/KDE/kdebase/konqueror/; revision=512833
parent 1178cb03
......@@ -31,7 +31,6 @@
#include <qfile.h>
//Added by qt3to4:
#include <QX11Info>
#include <Q3PtrList>
#include "konq_settingsxt.h"
// these DCOP calls come from outside, so any windows created by these
......
......@@ -18,7 +18,6 @@
#include <qtimer.h>
//Added by qt3to4:
#include <QVBoxLayout>
#include <Q3PtrList>
#include <kconfig.h>
#include <kdebug.h>
......
......@@ -26,7 +26,6 @@
#include "konq_guiclients.h"
#include "konq_viewmgr.h"
#include <kiconloader.h>
#include <Q3PtrList>
PopupMenuGUIClient::PopupMenuGUIClient( KonqMainWindow *mainWindow,
const KTrader::OfferList &embeddingServices,
......@@ -160,7 +159,6 @@ ToggleViewGUIClient::ToggleViewGUIClient( KonqMainWindow *mainWindow )
: QObject( mainWindow )
{
m_mainWindow = mainWindow;
m_actions.setAutoDelete( true );
KTrader::OfferList offers = KTrader::self()->query( "Browser/View" );
KTrader::OfferList::Iterator it = offers.begin();
......@@ -220,13 +218,7 @@ ToggleViewGUIClient::~ToggleViewGUIClient()
QList<KAction*> ToggleViewGUIClient::actions() const
{
QList<KAction*> res;
Q3DictIterator<KAction> it( m_actions );
for (; it.current(); ++it )
res.append( it.current() );
return res;
return m_actions.values();
}
void ToggleViewGUIClient::slotToggleView( bool toggle )
......@@ -317,7 +309,7 @@ void ToggleViewGUIClient::slotViewAdded( KonqView *view )
{
QString name = view->service()->desktopEntryName();
KAction *action = m_actions[ name ];
KAction *action = m_actions.value( name );
if ( action )
{
......@@ -346,7 +338,7 @@ void ToggleViewGUIClient::slotViewRemoved( KonqView *view )
{
QString name = view->service()->desktopEntryName();
KAction *action = m_actions[ name ];
KAction *action = m_actions.value( name );
if ( action )
{
......
......@@ -22,9 +22,7 @@
#include <kxmlguiclient.h>
#include <qobject.h>
#include <q3dict.h>
//Added by qt3to4:
#include <Q3PtrList>
#include <qhash.h>
#include <ktrader.h>
class KAction;
......@@ -91,7 +89,7 @@ private Q_SLOTS:
void slotViewRemoved( KonqView *view );
private:
KonqMainWindow *m_mainWindow;
Q3Dict<KAction> m_actions;
QHash<QString,KAction*> m_actions;
bool m_empty;
QMap<QString,bool> m_mapOrientation;
};
......
......@@ -68,10 +68,9 @@
//Added by qt3to4:
#include <QCustomEvent>
#include <QFocusEvent>
#include <Q3StrList>
#include <QKeyEvent>
#include <QEvent>
#include <Q3CString>
#include <QByteArray>
#include <QList>
#include <QCloseEvent>
#include <QPixmap>
......@@ -562,7 +561,7 @@ void KonqMainWindow::openURL( KonqView *_view, const KUrl &_url,
// Fast mode for local files: do the stat ourselves instead of letting KRun do it.
if ( serviceType.isEmpty() && url.isLocalFile() )
{
Q3CString _path( QFile::encodeName(url.path()));
QByteArray _path( QFile::encodeName(url.path()));
KDE_struct_stat buff;
if ( KDE_stat( _path.data(), &buff ) != -1 )
serviceType = KMimeType::findByURL( url, buff.st_mode )->name();
......@@ -3577,7 +3576,7 @@ void KonqMainWindow::showPageSecurity()
}
// called via DCOP from KonquerorIface
void KonqMainWindow::comboAction( int action, const QString& url, const Q3CString& objId )
void KonqMainWindow::comboAction( int action, const QString& url, const QByteArray& objId )
{
if (!s_lstViews) // this happens in "konqueror --silent"
return;
......@@ -3765,10 +3764,10 @@ void KonqMainWindow::initActions()
m_paActivateNextTab = new KAction( i18n( "Activate Next Tab" ), "tab_next", QApplication::isRightToLeft() ? KStdAccel::tabPrev() : KStdAccel::tabNext(), this, SLOT( slotActivateNextTab() ), actionCollection(), "activatenexttab" );
m_paActivatePrevTab = new KAction( i18n( "Activate Previous Tab" ), "tab_previous", QApplication::isRightToLeft() ? KStdAccel::tabNext() : KStdAccel::tabPrev(), this, SLOT( slotActivatePrevTab() ), actionCollection(), "activateprevtab" );
Q3CString actionname;
QString actionname;
for (int i=1;i<13;i++) {
actionname.sprintf("activate_tab_%02d", i);
new KAction(i18n("Activate Tab %1").arg(i), 0, this, SLOT(slotActivateTab()), actionCollection(), actionname);
new KAction(i18n("Activate Tab %1").arg(i), 0, this, SLOT(slotActivateTab()), actionCollection(), actionname.toUtf8());
}
m_paMoveTabLeft = new KAction( i18n("Move Tab Left"), 0 , Qt::CTRL+Qt::SHIFT+Qt::Key_Left,this, SLOT( slotMoveTabLeft()),actionCollection(),"tab_move_left");
......@@ -4713,7 +4712,7 @@ void KonqMainWindow::slotPopupMenu( KXMLGUIClient *client, const QPoint &_global
void KonqMainWindow::slotOpenEmbedded()
{
Q3CString name = sender()->name();
QByteArray name = sender()->name();
m_popupService = m_popupEmbeddingServices[ name.toInt() ]->desktopEntryName();
......
......@@ -28,7 +28,7 @@
#include <qpointer.h>
//Added by qt3to4:
#include <QPixmap>
#include <Q3CString>
#include <QByteArray>
#include <QCloseEvent>
#include <QList>
#include <QEvent>
......@@ -263,7 +263,7 @@ public:
// operates on all combos of all mainwindows of this instance
// up to now adds an entry or clears all entries
static void comboAction( int action, const QString& url,
const Q3CString& objId );
const QByteArray& objId );
#ifndef NDEBUG
void dumpViewList();
......
......@@ -24,7 +24,6 @@
#include <QDragEnterEvent>
#include <QLabel>
#include <QDropEvent>
#include <Q3PtrList>
#include <kapplication.h>
#include <kdebug.h>
......@@ -34,7 +33,6 @@
#include <kstandarddirs.h>
#include <kwin.h>
#include <kprotocolinfo.h>
#include <k3urldrag.h>
#include <kstartupinfo.h>
#include "konq_misc.h"
......@@ -250,9 +248,12 @@ void KonqDraggableLabel::mouseMoveEvent( QMouseEvent * ev )
{
KUrl::List lst;
lst.append( m_mw->currentView()->url() );
Q3DragObject * drag = new K3URLDrag( lst, m_mw );
QDrag* drag = new QDrag( m_mw );
QMimeData* md = new QMimeData();
lst.populateMimeData( md );
drag->setMimeData( md );
drag->setPixmap( KMimeType::pixmapForURL( lst.first(), 0, KIcon::Small ) );
drag->dragCopy();
drag->start();
}
}
}
......@@ -264,14 +265,15 @@ void KonqDraggableLabel::mouseReleaseEvent( QMouseEvent * )
void KonqDraggableLabel::dragEnterEvent( QDragEnterEvent *ev )
{
if ( K3URLDrag::canDecode( ev ) )
if ( KUrl::List::canDecode( ev->mimeData() ) )
ev->acceptAction();
}
void KonqDraggableLabel::dropEvent( QDropEvent* ev )
{
_savedLst.clear();
if ( K3URLDrag::decode( ev, _savedLst ) ) {
_savedLst = KUrl::List::fromMimeData( ev->mimeData() );
if ( !_savedLst.isEmpty() ) {
QTimer::singleShot(0, this, SLOT(delayedOpenURL()));
}
}
......
......@@ -23,7 +23,6 @@
#include <qapplication.h>
#include <qclipboard.h>
#include <q3ptrlist.h>
#include <qmenu.h>
#include <qtoolbutton.h>
#include <qtooltip.h>
......
......@@ -38,14 +38,13 @@
#include <assert.h>
#include <kdebug.h>
#include <kcursor.h>
#include <k3urldrag.h>
#include <q3scrollview.h>
#include <qapplication.h>
#include <qmetaobject.h>
#include <qobject.h>
//Added by qt3to4:
#include <Q3CString>
#include <QByteArray>
#include <QEvent>
#include <QDropEvent>
#include <QContextMenuEvent>
......@@ -121,7 +120,7 @@ KonqView::~KonqView()
part_url = m_pPart->url().url();
if (part_url.isNull())
part_url = "";
Q3CString line;
QByteArray line;
line = ( QString("close(%1):%2\n").arg(m_randID,0,16).arg(part_url) ).toUtf8();
KonqMainWindow::s_crashlog_file->write(line, line.length());
KonqMainWindow::s_crashlog_file->flush();
......@@ -158,7 +157,7 @@ void KonqView::openURL( const KUrl &url, const QString & locationBarURL,
if (url_url.isNull())
url_url = QString("");
Q3CString line;
QByteArray line;
line = ( QString("closed(%1):%2\n").arg(m_randID,0,16).arg(part_url) ).toUtf8();
KonqMainWindow::s_crashlog_file->write(line,line.length());
......@@ -1228,15 +1227,14 @@ bool KonqView::eventFilter( QObject *obj, QEvent *e )
{
QDragEnterEvent *ev = static_cast<QDragEnterEvent *>( e );
if ( K3URLDrag::canDecode( ev ) )
if ( KUrl::List::canDecode( ev->mimeData() ) )
{
KUrl::List lstDragURLs;
bool ok = K3URLDrag::decode( ev, lstDragURLs );
KUrl::List lstDragURLs = KUrl::List::fromMimeData( ev->mimeData() );
QObjectList children = m_pPart->widget()->queryList( "QWidget" );
if ( ok &&
!lstDragURLs.first().url().contains( "javascript:", false ) && // ### this looks like a hack to me
if ( !lstDragURLs.isEmpty()
&& !lstDragURLs.first().url().contains( "javascript:", false ) && // ### this looks like a hack to me
ev->source() != m_pPart->widget() &&
children.indexOf( ev->source() ) == -1 )
ev->acceptAction();
......@@ -1246,11 +1244,9 @@ bool KonqView::eventFilter( QObject *obj, QEvent *e )
{
QDropEvent *ev = static_cast<QDropEvent *>( e );
KUrl::List lstDragURLs;
bool ok = K3URLDrag::decode( ev, lstDragURLs );
KUrl::List lstDragURLs = KUrl::List::fromMimeData( ev->mimeData() );
KParts::BrowserExtension *ext = browserExtension();
if ( ok && ext && lstDragURLs.first().isValid() )
if ( !lstDragURLs.isEmpty() && ext && lstDragURLs.first().isValid() )
emit ext->openURLRequest( lstDragURLs.first() ); // this will call m_pMainWindow::slotOpenURLRequest delayed
}
......
......@@ -27,9 +27,6 @@
#include "konq_settingsxt.h"
#include <qfileinfo.h>
#include <q3ptrlist.h>
//Added by qt3to4:
#include <Q3StrList>
#include <kaccelgen.h>
#include <kstandarddirs.h>
......@@ -46,8 +43,6 @@
// #define DEBUG_VIEWMGR
template class Q3PtrList<KonqView>;
KonqViewManager::KonqViewManager( KonqMainWindow *mainWindow )
: KParts::PartManager( mainWindow )
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment