~ubuntu-branches/debian/sid/kde-baseapps/sid

« back to all changes in this revision

Viewing changes to konqueror/sidebar/trees/konq_sidebartree.cpp

  • Committer: Package Import Robot
  • Author(s): Modestas Vainius, Eshat Cakar, Pino Toscano
  • Date: 2012-06-09 22:18:08 UTC
  • mfrom: (4.2.1) (6.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20120609221808-h1l0ekd5qmb8nefr
Tags: 4:4.8.4-1
* New upstream release.

[ Eshat Cakar ]
* Add watch file.
* Bump kde-sc-dev-latest build dependency to version 4:4.8.4.
* Update installed files.

[ Pino Toscano ]
* Move files of the konqueror documentation from kde-baseapps-data to
  konqueror itself.

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
    m_sidebarModule = parent;
143
143
 
144
144
    m_animationTimer = new QTimer( this );
145
 
    connect( m_animationTimer, SIGNAL( timeout() ),
146
 
             this, SLOT( slotAnimation() ) );
 
145
    connect( m_animationTimer, SIGNAL(timeout()),
 
146
             this, SLOT(slotAnimation()) );
147
147
 
148
148
    m_currentBeforeDropItem = 0;
149
149
    m_dropItem = 0;
154
154
    setTreeStepSize(15);
155
155
 
156
156
    m_autoOpenTimer = new QTimer( this );
157
 
    connect( m_autoOpenTimer, SIGNAL( timeout() ),
158
 
             this, SLOT( slotAutoOpenFolder() ) );
 
157
    connect( m_autoOpenTimer, SIGNAL(timeout()),
 
158
             this, SLOT(slotAutoOpenFolder()) );
159
159
 
160
 
    connect( this, SIGNAL( doubleClicked( Q3ListViewItem * ) ),
161
 
             this, SLOT( slotDoubleClicked( Q3ListViewItem * ) ) );
162
 
    connect( this, SIGNAL( mouseButtonPressed(int, Q3ListViewItem*, const QPoint&, int)),
163
 
             this, SLOT( slotMouseButtonPressed(int, Q3ListViewItem*, const QPoint&, int)) );
164
 
    connect( this, SIGNAL( mouseButtonClicked( int, Q3ListViewItem*, const QPoint&, int ) ),
165
 
             this, SLOT( slotMouseButtonClicked( int, Q3ListViewItem*, const QPoint&, int ) ) );
166
 
    connect( this, SIGNAL( returnPressed( Q3ListViewItem * ) ),
167
 
             this, SLOT( slotDoubleClicked( Q3ListViewItem * ) ) );
168
 
    connect( this, SIGNAL( selectionChanged() ),
169
 
             this, SLOT( slotSelectionChanged() ) );
 
160
    connect( this, SIGNAL(doubleClicked(Q3ListViewItem*)),
 
161
             this, SLOT(slotDoubleClicked(Q3ListViewItem*)) );
 
162
    connect( this, SIGNAL(mouseButtonPressed(int,Q3ListViewItem*,QPoint,int)),
 
163
             this, SLOT(slotMouseButtonPressed(int,Q3ListViewItem*,QPoint,int)) );
 
164
    connect( this, SIGNAL(mouseButtonClicked(int,Q3ListViewItem*,QPoint,int)),
 
165
             this, SLOT(slotMouseButtonClicked(int,Q3ListViewItem*,QPoint,int)) );
 
166
    connect( this, SIGNAL(returnPressed(Q3ListViewItem*)),
 
167
             this, SLOT(slotDoubleClicked(Q3ListViewItem*)) );
 
168
    connect( this, SIGNAL(selectionChanged()),
 
169
             this, SLOT(slotSelectionChanged()) );
170
170
    connect(qApp->clipboard(), SIGNAL(dataChanged()),
171
171
            this, SLOT(slotSelectionChanged())); // so that "paste" can be updated
172
172
 
173
 
    connect( this, SIGNAL(itemRenamed(Q3ListViewItem*, const QString &, int)),
174
 
             this, SLOT(slotItemRenamed(Q3ListViewItem*, const QString &, int)));
 
173
    connect( this, SIGNAL(itemRenamed(Q3ListViewItem*,QString,int)),
 
174
             this, SLOT(slotItemRenamed(Q3ListViewItem*,QString,int)));
175
175
 
176
176
    if (moduleType == VIRT_Folder) {
177
177
        m_dirtreeDir.dir.setPath(KGlobal::dirs()->saveLocation("data","konqsidebartng/virtual_folders/"+path+'/'));
215
215
    action = new KAction(i18n("Rename"), this);
216
216
    action->setIcon(KIcon("edit-rename"));
217
217
    m_collection->addAction("rename", action);
218
 
    connect(action, SIGNAL(triggered(bool) ), SLOT( slotRename() ));
 
218
    connect(action, SIGNAL(triggered(bool)), SLOT(slotRename()));
219
219
 
220
220
    action = new KAction(KIcon("edit-delete"), i18n("Delete Link"), this);
221
221
    m_collection->addAction("delete_link", action);
613
613
    kDebug(1201) << "KonqSidebarTree::slotFilesAdded " << dir;
614
614
    if ( m_dirtreeDir.dir.isParentOf( urlDir ) )
615
615
        // We use a timer in case of DBus re-entrance..
616
 
        QTimer::singleShot( 0, this, SLOT( rescanConfiguration() ) );
 
616
        QTimer::singleShot( 0, this, SLOT(rescanConfiguration()) );
617
617
}
618
618
 
619
619
void KonqSidebarTree::slotFilesRemoved( const QStringList & urls )
625
625
        //kDebug(1201) <<  "KonqSidebarTree::slotFilesRemoved " << u;
626
626
        if ( m_dirtreeDir.dir.isParentOf( u ) )
627
627
        {
628
 
            QTimer::singleShot( 0, this, SLOT( rescanConfiguration() ) );
 
628
            QTimer::singleShot( 0, this, SLOT(rescanConfiguration()) );
629
629
            kDebug(1201) << "KonqSidebarTree::slotFilesRemoved done";
630
630
            return;
631
631
        }
894
894
{
895
895
    Q_ASSERT(col==0);
896
896
    if (col != 0) return;
897
 
    assert(item);
 
897
    Q_ASSERT(item);
898
898
    KonqSidebarTreeItem * treeItem = static_cast<KonqSidebarTreeItem *>(item);
899
899
    treeItem->rename( name );
900
900
}
1024
1024
                         browserArgs);
1025
1025
}
1026
1026
 
 
1027
static QMimeData* mimeDataFor(const KUrl& url)
 
1028
{
 
1029
  QMimeData* data = new QMimeData();
 
1030
  QList<QUrl> urlList;
 
1031
  urlList.append(QUrl(url));
 
1032
  data->setUrls(urlList);
 
1033
  return data;
 
1034
}
 
1035
 
1027
1036
void KonqSidebarTree::slotCopyLocation()
1028
1037
{
1029
1038
    if (!m_currentTopLevelItem) return;
1030
1039
    KUrl url = m_currentTopLevelItem->externalURL();
1031
 
    qApp->clipboard()->setData( new K3URLDrag(url, 0), QClipboard::Selection );
1032
 
    qApp->clipboard()->setData( new K3URLDrag(url, 0), QClipboard::Clipboard );
 
1040
    qApp->clipboard()->setMimeData( mimeDataFor(url), QClipboard::Selection );
 
1041
    qApp->clipboard()->setMimeData( mimeDataFor(url), QClipboard::Clipboard );
1033
1042
}
1034
1043
 
1035
1044
///////////////////////////////////////////////////////////////////