-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 57 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 1 |
2 files changed, 45 insertions, 13 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 0f2555d..c054465 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -139,4 +139,5 @@ AdvancedFm::AdvancedFm( ) | |||
139 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); | 139 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); |
140 | fileMenu->insertSeparator(); | 140 | fileMenu->insertSeparator(); |
141 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); | ||
141 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); | 142 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); |
142 | fileMenu->setCheckable(TRUE); | 143 | fileMenu->setCheckable(TRUE); |
@@ -295,5 +296,5 @@ void AdvancedFm::cleanUp() | |||
295 | } | 296 | } |
296 | 297 | ||
297 | void AdvancedFm::tabChanged(QWidget *w) | 298 | void AdvancedFm::tabChanged(QWidget *) |
298 | { | 299 | { |
299 | if (TabWidget->currentPageIndex() == 0) { | 300 | if (TabWidget->currentPageIndex() == 0) { |
@@ -333,9 +334,9 @@ void AdvancedFm::populateLocalView() | |||
333 | QString symLink=fi->readLink(); | 334 | QString symLink=fi->readLink(); |
334 | QFileInfo sym( symLink); | 335 | QFileInfo sym( symLink); |
335 | fileS.sprintf( "%10li", sym.size() ); | 336 | fileS.sprintf( "%10i", sym.size() ); |
336 | fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() ); | 337 | fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() ); |
337 | fileDate = sym.lastModified().toString(); | 338 | fileDate = sym.lastModified().toString(); |
338 | } else { | 339 | } else { |
339 | fileS.sprintf( "%10li", fi->size() ); | 340 | fileS.sprintf( "%10i", fi->size() ); |
340 | fileL.sprintf( "%s",fi->fileName().data() ); | 341 | fileL.sprintf( "%s",fi->fileName().data() ); |
341 | fileDate= fi->lastModified().toString(); | 342 | fileDate= fi->lastModified().toString(); |
@@ -432,10 +433,10 @@ void AdvancedFm::populateRemoteView() | |||
432 | // qDebug("Symlink detected "+symLink); | 433 | // qDebug("Symlink detected "+symLink); |
433 | QFileInfo sym( symLink); | 434 | QFileInfo sym( symLink); |
434 | fileS.sprintf( "%10li", sym.size() ); | 435 | fileS.sprintf( "%10i", sym.size() ); |
435 | fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() ); | 436 | fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() ); |
436 | fileDate = sym.lastModified().toString(); | 437 | fileDate = sym.lastModified().toString(); |
437 | } else { | 438 | } else { |
438 | // qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); | 439 | // qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); |
439 | fileS.sprintf( "%10li", fi->size() ); | 440 | fileS.sprintf( "%10i", fi->size() ); |
440 | fileL.sprintf( "%s",fi->fileName().data() ); | 441 | fileL.sprintf( "%s",fi->fileName().data() ); |
441 | fileDate= fi->lastModified().toString(); | 442 | fileDate= fi->lastModified().toString(); |
@@ -630,5 +631,5 @@ void AdvancedFm::showRemoteHidden() | |||
630 | } | 631 | } |
631 | 632 | ||
632 | void AdvancedFm::localListPressed( int mouse, QListViewItem *item, const QPoint &point, int i) | 633 | void AdvancedFm::localListPressed( int mouse, QListViewItem *, const QPoint& , int ) |
633 | { | 634 | { |
634 | qDebug("list pressed"); | 635 | qDebug("list pressed"); |
@@ -643,5 +644,5 @@ void AdvancedFm::localListPressed( int mouse, QListViewItem *item, const QPoint | |||
643 | } | 644 | } |
644 | 645 | ||
645 | void AdvancedFm::remoteListPressed( int mouse, QListViewItem *item, const QPoint &point, int i) | 646 | void AdvancedFm::remoteListPressed( int mouse, QListViewItem*, const QPoint&, int ) |
646 | { | 647 | { |
647 | 648 | ||
@@ -1300,5 +1301,5 @@ void AdvancedFm::copySameDir() { | |||
1300 | tr("Yes"),tr("No"),0,0,1) ) { | 1301 | tr("Yes"),tr("No"),0,0,1) ) { |
1301 | case 0: | 1302 | case 0: |
1302 | qDebug(""); | 1303 | |
1303 | f.remove(); | 1304 | f.remove(); |
1304 | break; | 1305 | break; |
@@ -1801,5 +1802,5 @@ void AdvancedFm::doBeam() { | |||
1801 | } | 1802 | } |
1802 | 1803 | ||
1803 | void AdvancedFm::fileBeamFinished( Ir *ir) { | 1804 | void AdvancedFm::fileBeamFinished( Ir *) { |
1804 | QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); | 1805 | QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); |
1805 | 1806 | ||
@@ -1857,9 +1858,10 @@ void AdvancedFm::showFileMenu() { | |||
1857 | m->insertItem( tr( "Move" ), this, SLOT( move() )); | 1858 | m->insertItem( tr( "Move" ), this, SLOT( move() )); |
1858 | m->insertSeparator(); | 1859 | m->insertSeparator(); |
1860 | m->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); | ||
1859 | 1861 | ||
1860 | if(isLocalView) | 1862 | // if(isLocalView) |
1861 | m->insertItem( tr( "Rescan" ), this, SLOT( populateLocalView() )); | 1863 | // m->insertItem( tr( "Rescan" ), this, SLOT( populateLocalView() )); |
1862 | else | 1864 | // else |
1863 | m->insertItem( tr( "Rescan" ), this, SLOT( populateRemoteView() )); | 1865 | // m->insertItem( tr( "Rescan" ), this, SLOT( populateRemoteView() )); |
1864 | 1866 | ||
1865 | m->insertItem( tr( "Run Command" ), this, SLOT( runCommand() )); | 1867 | m->insertItem( tr( "Run Command" ), this, SLOT( runCommand() )); |
@@ -1882,4 +1884,5 @@ void AdvancedFm::showFileMenu() { | |||
1882 | else | 1884 | else |
1883 | m->setItemChecked(m->idAt(0),FALSE); | 1885 | m->setItemChecked(m->idAt(0),FALSE); |
1886 | |||
1884 | if(Ir::supported()) | 1887 | if(Ir::supported()) |
1885 | m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); | 1888 | m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); |
@@ -1916,2 +1919,30 @@ QString AdvancedFm::checkDiskSpace(const QString &path) { | |||
1916 | } | 1919 | } |
1917 | 1920 | ||
1921 | void AdvancedFm::addToDocs() { | ||
1922 | QStringList strListPaths = getPath(); | ||
1923 | if( strListPaths.count() > 0) { | ||
1924 | QString curFile; | ||
1925 | if (TabWidget->currentPageIndex() == 0) { | ||
1926 | for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) { | ||
1927 | curFile = currentDir.canonicalPath()+"/"+(*it); | ||
1928 | qDebug(curFile); | ||
1929 | DocLnk f; | ||
1930 | // curFile.replace(QRegExp("\\..*"),""); | ||
1931 | f.setName((*it)); | ||
1932 | f.setFile( curFile); | ||
1933 | f.writeLink(); | ||
1934 | } | ||
1935 | } else { | ||
1936 | for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) { | ||
1937 | curFile = currentRemoteDir.canonicalPath()+"/"+(*it); | ||
1938 | qDebug(curFile); | ||
1939 | |||
1940 | DocLnk f; | ||
1941 | // curFile.replace(QRegExp("\\..*"),""); | ||
1942 | f.setName((*it)); | ||
1943 | f.setFile( curFile); | ||
1944 | f.writeLink(); | ||
1945 | } | ||
1946 | } | ||
1947 | } | ||
1948 | } | ||
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index 5b714ae..53dad50 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h | |||
@@ -68,4 +68,5 @@ public: | |||
68 | int currentServerConfig; | 68 | int currentServerConfig; |
69 | protected slots: | 69 | protected slots: |
70 | void addToDocs(); | ||
70 | void doLocalCd(); | 71 | void doLocalCd(); |
71 | void doRemoteCd(); | 72 | void doRemoteCd(); |