diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/AUTHORS /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/AUTHORS --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/AUTHORS 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/AUTHORS 2022-02-24 02:07:08.000000000 +0000 @@ -8,6 +8,7 @@ * Wittfella * version 1.0 to 5.5 (2010-2012). + Contributors ============ @@ -18,3 +19,8 @@ * slackuser0xae34 * psikoz + +Absolute Linux Modification +=========================== + +* Paul Sherman \ No newline at end of file diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/README.md /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/README.md --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/README.md 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/README.md 2022-02-24 02:07:08.000000000 +0000 @@ -33,14 +33,14 @@ | Toggle Show Hidden Files | [ctrl+h] | | Move to Trash | [del] | | Delete | [shift+del] | -| Open Terminal | [F1] | +| Open Terminal | [F4] | | Quit/Close | [ctrl+q] | | Rename Action | [F2] | | Zoom Out | [ctrl+-] | | Zoom In | [ctrl++] | | Focus Path | [ctrl+l] | -| Toggle Icon View | [F3] | -| Toggle Detail View | [F4] | +| Toggle Icon View | [F7] | +| Toggle Detail View | [F8] | | Refresh View | [F5] | | Drag and Drop Move Modifier | [shift] | | Drag and Drop Copy Modifier | [ctrl] | diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/absolute.qss /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/absolute.qss --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/absolute.qss 1970-01-01 00:00:00.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/absolute.qss 2022-03-03 23:05:21.000000000 +0000 @@ -0,0 +1,69 @@ +/* + Style Sheet +*/ +QMenu::item { + padding:4px 7px 4px 17px; + border:3px solid #2E2F30; +} +QMenu::item:selected { + color:rgb(255,255,255); + background-color: #C37C44; + border:3px solid #C37C44; +} +QMenu::item:disabled { + color: #777777; + background: none; /* remove menu highlighting on disabled items */ +} +QScrollBar:vertical { + border: 2px solid grey; + background: #466FA1; + width: 20px; + margin: 22px 0px 22px 0px; +} +QScrollBar::handle:vertical { + border: 2px solid #569FFE; + background: #438CEB; + min-height: 20px; +} +QScrollBar::add-line:vertical { + border-image: url(:/images/arrow_down.png); + height: 10px; + width: 16px; + margin:2px; +} +QScrollBar::sub-line:vertical { + border-image: url(:/images/arrow_up.png); + height: 10px; + width: 16px; + margin:2px; +} +QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { + background: none; +} + +QMenu { + border-width: 2px; + border-radius: 10px; + border-color: #C37C44; + border-style: outset; +} +QLineEdit{ + selection-color: #000000; + selection-background-color:#FF9900; + } +QListView{ + selection-color: #000000; + selection-background-color:#FF9900; + } +QTextEdit{ + selection-color: #000000; + selection-background-color:#FF9900; + } +QTreeView{ + selection-color: #000000; + selection-background-color:#FF9900; + } +QComboBox{ + selection-color: #000000; + selection-background-color:#FF9900; + } \ No newline at end of file diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm/src/actiondefs.cpp /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm/src/actiondefs.cpp --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm/src/actiondefs.cpp 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm/src/actiondefs.cpp 2022-02-27 01:50:43.000000000 +0000 @@ -37,36 +37,41 @@ out >> *actionIcons; icons.close();*/ - if (actionIcons->count() < 29) { - actionIcons->append(QIcon::fromTheme("folder-new",QIcon(":/images/folder-new.png"))); - actionIcons->append(QIcon::fromTheme("document-new",QIcon(":/images/document-new.png"))); - actionIcons->append(QIcon::fromTheme("edit-cut",QIcon(":/images/cut.png"))); - actionIcons->append(QIcon::fromTheme("edit-copy",QIcon(":/images/copy.png"))); - actionIcons->append(QIcon::fromTheme("edit-paste",QIcon(":/images/paste.png"))); - actionIcons->append(QIcon::fromTheme("go-up",QIcon(":/images/up.png"))); - actionIcons->append(QIcon::fromTheme("go-previous",QIcon(":/images/back.png"))); - actionIcons->append(QIcon::fromTheme("go-home",QIcon(":/images/home.png"))); - actionIcons->append(QIcon::fromTheme("view-list-details",QIcon(":/images/details.png"))); - actionIcons->append(QIcon::fromTheme("view-list-icons",QIcon(":/images/icons.png"))); - actionIcons->append(QIcon::fromTheme("folder-saved-search",QIcon(":/images/hidden.png"))); - actionIcons->append(QIcon::fromTheme("address-book-new",QIcon(":/images/bookmark.png"))); - actionIcons->append(QIcon::fromTheme("bookmark-new",QIcon(":/images/bookmark.png"))); - actionIcons->append(QIcon::fromTheme("edit-clear",QIcon(":/images/clear.png"))); - actionIcons->append(QIcon::fromTheme("edit-delete",QIcon(":/images/delete.png"))); - actionIcons->append(QIcon::fromTheme("preferences-system",QIcon(":/images/preferences.png"))); - actionIcons->append(QIcon::fromTheme("document-properties",QIcon(":/images/properties.png"))); - actionIcons->append(QIcon::fromTheme("utilities-terminal",QIcon(":/images/terminal.png"))); - actionIcons->append(QIcon::fromTheme("document-open",QIcon(":/images/document-open.png"))); - actionIcons->append(QIcon::fromTheme("view-refresh",QIcon(":/images/refresh.png"))); - actionIcons->append(QIcon::fromTheme("application-exit",QIcon(":/images/exit.png"))); - actionIcons->append(QIcon::fromTheme("lock",QIcon(":/images/lock.png"))); - actionIcons->append(QIcon::fromTheme("key_bindings",QIcon(":/images/key_bindings.png"))); - actionIcons->append(QIcon::fromTheme("zoom-in",QIcon(":/images/zoom-in.png"))); - actionIcons->append(QIcon::fromTheme("zoom-out",QIcon(":/images/zoom-out.png"))); - actionIcons->append(QIcon::fromTheme("window-close",QIcon(":/images/window-close.png"))); - actionIcons->append(QIcon::fromTheme("tab-new",QIcon(":/images/folder-new.png"))); //26 - actionIcons->append(QIcon::fromTheme("user-trash",QIcon(":/images/user-trash.png"))); //27 - actionIcons->append(QIcon::fromTheme("document-new",QIcon(":/images/document-new.png"))); //28 + if (actionIcons->count() < 34) { + actionIcons->append(QIcon::fromTheme("folder-new",QIcon(":/images/folder-new.png"))); //0 + actionIcons->append(QIcon::fromTheme("document-new",QIcon(":/images/document-new.png"))); //1 + actionIcons->append(QIcon::fromTheme("edit-cut",QIcon(":/images/cut.png"))); //2 + actionIcons->append(QIcon::fromTheme("",QIcon(":/images/paste.png"))); //3 + actionIcons->append(QIcon::fromTheme("",QIcon(":/images/copy.png"))); //4 + actionIcons->append(QIcon::fromTheme("go-up",QIcon(":/images/up.png"))); //5 + actionIcons->append(QIcon::fromTheme("go-previous",QIcon(":/images/back.png"))); //6 + actionIcons->append(QIcon::fromTheme("go-home",QIcon(":/images/home.png"))); //7 + actionIcons->append(QIcon::fromTheme("view-list-details",QIcon(":/images/details.png"))); //8 + actionIcons->append(QIcon::fromTheme("view-list-icons",QIcon(":/images/icons.png"))); //9 + actionIcons->append(QIcon::fromTheme("",QIcon(":/images/hidden.png"))); //10 + actionIcons->append(QIcon::fromTheme("address-book-new",QIcon(":/images/bookmark.png"))); //11 + actionIcons->append(QIcon::fromTheme("bookmark-new",QIcon(":/images/bookmark.png"))); //12 + actionIcons->append(QIcon::fromTheme("edit-clear",QIcon(":/images/clear.png"))); //13 + actionIcons->append(QIcon::fromTheme("edit-delete",QIcon(":/images/delete.png"))); //14 + actionIcons->append(QIcon::fromTheme("preferences-system",QIcon(":/images/preferences.png")));//15 + actionIcons->append(QIcon::fromTheme("document-properties",QIcon(":/images/properties.png")));//16 + actionIcons->append(QIcon::fromTheme("",QIcon(":/images/terminal.png"))); //17 + actionIcons->append(QIcon::fromTheme("document-open",QIcon(":/images/document-open.png")));//18 + actionIcons->append(QIcon::fromTheme("",QIcon(":/images/refresh.png"))); //19 + actionIcons->append(QIcon::fromTheme("application-exit",QIcon(":/images/exit.png"))); //20 + actionIcons->append(QIcon::fromTheme("lock",QIcon(":/images/lock.png"))); //21 + actionIcons->append(QIcon::fromTheme("key_bindings",QIcon(":/images/key_bindings.png"))); //22 + actionIcons->append(QIcon::fromTheme("zoom-in",QIcon(":/images/zoom-in.png"))); //23 + actionIcons->append(QIcon::fromTheme("zoom-out",QIcon(":/images/zoom-out.png"))); //24 + actionIcons->append(QIcon::fromTheme("window-close",QIcon(":/images/window-close.png"))); //25 + actionIcons->append(QIcon::fromTheme("tab-new",QIcon(":/images/folder-new.png"))); //26 + actionIcons->append(QIcon::fromTheme("document-new",QIcon(":/images/document-new.png"))); //27 + actionIcons->append(QIcon::fromTheme("",QIcon(":/images/arox.png"))); //28 + actionIcons->append(QIcon::fromTheme("",QIcon(":/images/to-clipboard.png"))); //29 + actionIcons->append(QIcon::fromTheme("",QIcon(":/images/find.png"))); //30 + actionIcons->append(QIcon::fromTheme("",QIcon(":/images/unmount.png"))); //31 + actionIcons->append(QIcon::fromTheme("",QIcon(":/images/scite.png"))); //32 + actionIcons->append(QIcon::fromTheme("",QIcon(":/images/arox-compress.png"))); //33 /*icons.open(QIODevice::WriteOnly); QDataStream out(&icons); out << *actionIcons; @@ -93,8 +98,14 @@ newWinAct = new QAction(tr("New window"), this); connect(newWinAct, SIGNAL(triggered()), this, SLOT(newWindow())); - newWinAct->setIcon(actionIcons->at(28)); + newWinAct->setIcon(actionIcons->at(27)); actionList->append(newWinAct); + + unmountAct = new QAction(tr("Un-Mount"), this); + unmountAct->setStatusTip(tr("Un-Mount Folder")); + connect(unmountAct, SIGNAL(triggered()), this, SLOT(unMount())); + unmountAct->setIcon(actionIcons->at(31)); + actionList->append(unmountAct); openTabAct = new QAction(tr("New tab"), this); openTabAct->setStatusTip(tr("Middle-click things to open tab")); @@ -102,6 +113,11 @@ openTabAct->setIcon(actionIcons->at(26)); actionList->append(openTabAct); + findAct = new QAction(tr("Find"), this); + connect(findAct, SIGNAL(triggered()), this, SLOT(findRun())); + findAct->setIcon(actionIcons->at(30)); + actionList->append(findAct); + openInTabAct = new QAction(tr("Open in new tab"), this); connect(openInTabAct, SIGNAL(triggered()), this, SLOT(openNewTab())); openInTabAct->setIcon(actionIcons->at(26)); @@ -125,18 +141,18 @@ cutAct->setIcon(actionIcons->at(2)); actionList->append(cutAct); - copyAct = new QAction(tr("Copy"), this); - copyAct->setStatusTip(tr("Copy the current file")); - connect(copyAct, SIGNAL(triggered()), this, SLOT(copyFile())); - copyAct->setIcon(actionIcons->at(3)); - actionList->append(copyAct); - pasteAct = new QAction(tr("Paste"), this); pasteAct->setStatusTip(tr("Paste the file here")); pasteAct->setEnabled(false); connect(pasteAct, SIGNAL(triggered()), this, SLOT(pasteClipboard())); - pasteAct->setIcon(actionIcons->at(4)); + pasteAct->setIcon(actionIcons->at(3)); actionList->append(pasteAct); + + copyAct = new QAction(tr("Copy"), this); + copyAct->setStatusTip(tr("Copy the current file")); + connect(copyAct, SIGNAL(triggered()), this, SLOT(copyFile())); + copyAct->setIcon(actionIcons->at(4)); + actionList->append(copyAct); upAct = new QAction(tr("Up"),this); upAct->setStatusTip(tr("Go up one directory")); @@ -158,6 +174,20 @@ homeAct->setIcon(actionIcons->at(7)); actionList->append(homeAct); + aroxAct = new QAction(tr("Arox"), this); + aroxAct->setStatusTip(tr("open in Arox")); + connect(aroxAct, SIGNAL(triggered()), this, SLOT(aroxRun())); + actionIcons->append(newDirAct->icon()); + aroxAct->setIcon(actionIcons->at(28)); + actionList->append(aroxAct); + + textAct = new QAction(tr("Open As Text"), this); + textAct->setStatusTip(tr("open file as text")); + connect(textAct, SIGNAL(triggered()), this, SLOT(openASTEXT())); + actionIcons->append(newDirAct->icon()); + textAct->setIcon(actionIcons->at(32)); + actionList->append(textAct); + newTabAct = new QAction(tr("New tab"), this); newTabAct->setStatusTip(tr("Open new tab")); connect(newTabAct, SIGNAL(triggered()), this, SLOT(openTab())); @@ -243,12 +273,6 @@ connect(wrapBookmarksAct, SIGNAL(triggered()),this,SLOT(toggleWrapBookmarks())); actionList->append(wrapBookmarksAct); - trashAct = new QAction(tr("Move to Trash"), this); - trashAct->setStatusTip(tr("Move selected to trash")); - connect(trashAct, SIGNAL(triggered(bool)), this, SLOT(trashFile())); - trashAct->setIcon(actionIcons->at(27)); - actionList->append(trashAct); - deleteAct = new QAction(tr("Delete"), this); deleteAct->setStatusTip(tr("Delete selected")); connect(deleteAct, SIGNAL(triggered()), this, SLOT(deleteFile())); @@ -267,6 +291,18 @@ connect(renameAct, SIGNAL(triggered()),this, SLOT(renameFile())); actionList->append(renameAct); + copypathAct = new QAction(tr("Copy Path"), this); + copypathAct->setStatusTip(tr("Copy Path")); + copypathAct->setIcon(actionIcons->at(29)); + connect(copypathAct, SIGNAL(triggered()),this, SLOT(copyPath())); + actionList->append(copypathAct); + + compressDirAct = new QAction(tr("Compress"), this); + compressDirAct->setStatusTip(tr("Compress as...")); + compressDirAct->setIcon(actionIcons->at(33)); + connect(compressDirAct, SIGNAL(triggered()),this, SLOT(compressDir())); + actionList->append(compressDirAct); + terminalAct = new QAction(tr("Terminal"), this); terminalAct->setStatusTip(tr("Open virtual terminal")); connect(terminalAct, SIGNAL(triggered()), this, SLOT(terminalRun())); @@ -301,13 +337,6 @@ closeAct->setIcon(actionIcons->at(25)); actionList->append(closeAct); - thumbsAct = new QAction(tr("Show thumbs"), this); - thumbsAct->setStatusTip(tr("View thumbnails for image files")); - thumbsAct->setCheckable(true); - thumbsAct->setIcon(QIcon::fromTheme("image-x-generic")); - connect(thumbsAct, SIGNAL(triggered()), this, SLOT(toggleThumbs())); - actionList->append(thumbsAct); - folderPropertiesAct = new QAction(tr("Properties"), this); folderPropertiesAct->setStatusTip(tr("View properties of selected items")); connect(folderPropertiesAct, SIGNAL(triggered()), this, SLOT(folderPropertiesLauncher())); @@ -408,6 +437,7 @@ if (shortcuts.count() == 0) { shortcuts.insert(newWinAct->text(),"ctrl+n"); shortcuts.insert(openTabAct->text(),"ctrl+t"); + shortcuts.insert(findAct->text(),"ctrl+f"); shortcuts.insert(closeTabAct->text(),"ctrl+w"); shortcuts.insert(cutAct->text(),"ctrl+x"); shortcuts.insert(copyAct->text(),"ctrl+c"); @@ -416,18 +446,18 @@ shortcuts.insert(backAct->text(),"backspace"); //shortcuts.insert(homeAct->text(),"f1"); shortcuts.insert(hiddenAct->text(),"ctrl+h"); - shortcuts.insert(trashAct->text(), "del"); - shortcuts.insert(deleteAct->text(),"shift+del"); - shortcuts.insert(terminalAct->text(),"f1"); + shortcuts.insert(deleteAct->text(),"del"); + shortcuts.insert(terminalAct->text(),"f4"); shortcuts.insert(exitAct->text(),"ctrl+q"); shortcuts.insert(renameAct->text(),"f2"); + shortcuts.insert(copypathAct->text(),"f3"); //shortcuts.insert(escapeAct->text(),"esc"); shortcuts.insert(refreshAct->text(), "f5"); shortcuts.insert(zoomOutAct->text(),"ctrl+-"); shortcuts.insert(zoomInAct->text(),"ctrl++"); shortcuts.insert(focusAddressAct->text(), "ctrl+l"); - shortcuts.insert(iconAct->text(), "f3"); - shortcuts.insert(detailAct->text(), "f4"); + shortcuts.insert(iconAct->text(), "f7"); + shortcuts.insert(detailAct->text(), "f8"); settings->beginGroup("customShortcuts"); QHashIterator i(shortcuts); @@ -504,6 +534,7 @@ fileMenu->addSeparator(); fileMenu->addAction(newWinAct); fileMenu->addAction(openTabAct); + fileMenu->addAction(findAct); fileMenu->addSeparator(); fileMenu->addAction(closeAct); fileMenu->addAction(exitAct); @@ -515,7 +546,7 @@ editMenu->addAction(copyAct); editMenu->addAction(pasteAct); editMenu->addAction(renameAct); - editMenu->addAction(trashAct); + editMenu->addAction(copypathAct); editMenu->addAction(deleteAct); editMenu->addSeparator(); editMenu->addAction(addBookmarkAct); @@ -548,7 +579,6 @@ viewMenu->addAction(hiddenAct); viewMenu->addSeparator(); viewMenu->addAction(tabsOnTopAct); - viewMenu->addAction(thumbsAct); viewMenu->addSeparator(); viewMenu->addAction(zoomInAct); viewMenu->addAction(zoomOutAct); @@ -585,6 +615,7 @@ navToolBar->addAction(backAct); navToolBar->addAction(upAct); navToolBar->addAction(homeAct); + navToolBar->addAction(aroxAct); addressToolBar = addToolBar(tr("Address")); addressToolBar->setObjectName("Address"); diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm/src/actiontriggers.cpp /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm/src/actiontriggers.cpp --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm/src/actiontriggers.cpp 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm/src/actiontriggers.cpp 2022-04-02 02:33:29.170735012 +0000 @@ -12,7 +12,6 @@ #include #endif #include - /** * @brief Executes a file * @param index @@ -55,6 +54,12 @@ mimeUtils->openInApp(filePath, ""/*term*/); } } + +//--------------------------------------------------------------------------- +void MainWindow::compressDir() { + const QString cmd = "atool-compress " + modelList->filePath(modelView->mapToSource(listSelectionModel->currentIndex())); + QProcess::startDetached(cmd); +} //--------------------------------------------------------------------------- /** @@ -223,6 +228,61 @@ //--------------------------------------------------------------------------- /** + * @brief Starts Arox + */ +void MainWindow::aroxRun() { + static QString arg = pathEdit->itemText(0); + const QString cmd = "arox " + QStringList(arg); + QProcess::startDetached(cmd); +} +//--------------------------------------------------------------------------- + +/** + * @brief opens file as text with scite + */ +void MainWindow::openASTEXT() { + const QString cmd = "scite " + modelList->filePath(modelView->mapToSource(listSelectionModel->currentIndex())); + QProcess::startDetached(cmd); +} +//--------------------------------------------------------------------------- + +/** + * @brief Runs find app from current dir + */ +void MainWindow::findRun() { + const QString cmd = "/usr/local/bin/ff.py " + pathEdit->itemText(0); + QProcess::startDetached(cmd); +} +//--------------------------------------------------------------------------- +/** + * @brief Runs find app from current dir + */ +void MainWindow::unMount() { + // Temporary selection files + QModelIndexList selList; + QStringList fileList; + // Selection + if (focusWidget() == tree) { + selList << modelView->mapFromSource(modelList->index(pathEdit->itemText(0))); + } else if (listSelectionModel->selectedRows(0).count()) { + selList = listSelectionModel->selectedRows(0); + } else { + selList = listSelectionModel->selectedIndexes(); + } + // Retrieve selected indices + foreach (QModelIndex item, selList) { + fileList.append(modelList->filePath(modelView->mapToSource(item))); + } + for (int i=0;imapFromSource(modelList->index(pathEdit->itemText(0))); - } else if (listSelectionModel->selectedRows(0).count()) { - selList = listSelectionModel->selectedRows(0); - } else { - selList = listSelectionModel->selectedIndexes(); - } - - // Retrieve selected indices - foreach (QModelIndex item, selList) { - fileList.append(modelList->filePath(modelView->mapToSource(item))); - } - - bool ok = true; - for (int i=0;isetText(modelList->filePath(modelView->mapToSource(listSelectionModel->currentIndex())), QClipboard::Selection); + QApplication::clipboard()->setText(modelList->filePath(modelView->mapToSource(listSelectionModel->currentIndex())), QClipboard::Clipboard); +} +//--------------------------------------------------------------------------- + +/** * @brief Pastes list of files/dirs into new path * @param files list of files * @param newPath new (destination) path @@ -875,8 +895,6 @@ list->setGridSize(QSize(zoom, zoom)); list->setIconSize(QSize(zoom, zoom)); list->setFlow(QListView::LeftToRight); - - modelList->setMode(thumbsAct->isChecked()); stackWidget->setCurrentIndex(0); detailAct->setChecked(0); @@ -892,8 +910,6 @@ list->setGridSize(QSize()); list->setIconSize(QSize(zoomList, zoomList)); list->setFlow(QListView::TopToBottom); - - modelList->setMode(thumbsAct->isChecked()); list->setMouseTracking(false); if (tabs->count()) tabs->setType(0); @@ -967,16 +983,6 @@ modelView->sort(currentSortColumn, currentSortOrder); } //--------------------------------------------------------------------------- - -/** - * @brief Switches from thumbs to details and vice versa - */ -void MainWindow::toggleThumbs() { - if (currentView != 2) toggleIcons(); - else toggleDetails(); -} -//--------------------------------------------------------------------------- - /** * @brief Toggles details */ @@ -993,7 +999,6 @@ } detailTree->setMouseTracking(true); stackWidget->setCurrentIndex(1); - modelList->setMode(thumbsAct->isChecked()); iconAct->setChecked(0); if (tabs->count()) { tabs->setType(2); @@ -1042,7 +1047,10 @@ " (at your option) any later version.

" "

" "" - "https://qtfm.eu

")); + "https://qtfm.eu

" + "

Modified for Absolute Linux

" + "

" + "absolutelinux.org

")); QString details; QFile authorsFile(":/AUTHORS"); if (authorsFile.open(QIODevice::Text|QIODevice::ReadOnly)) { @@ -1077,8 +1085,7 @@ // Reload settings loadSettings(false /* dont reload window state/geo */, false /* dont reload hidden state */, - false /* dont reload tabs state */, - false /* dont reload thumb state */); + false /* dont reload tabs state */); // If icon theme has changed, use new theme and clear cache QString newTheme = settings->value("forceTheme").toString(); diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm/src/main.cpp /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm/src/main.cpp --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm/src/main.cpp 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm/src/main.cpp 2022-02-28 02:27:41.000000000 +0000 @@ -38,6 +38,7 @@ #include #include +#include void msgHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) { @@ -96,16 +97,10 @@ QApplication::setOrganizationDomain("eu"); // Initialize resources - //Q_INIT_RESOURCE(resources); - - // Translate application - /*QTranslator qtTranslator; - qtTranslator.load("qt_" + QLocale::system().name(), - QLibraryInfo::location(QLibraryInfo::TranslationsPath)); - app.installTranslator(&qtTranslator); - QTranslator qtfmTranslator; - qtfmTranslator.load("/usr/share/qtfm/qtfm_" + QLocale::system().name()); - app.installTranslator(&qtfmTranslator);*/ + QFile File(":/absolute.qss"); + File.open(QFile::ReadOnly); + QString styleSheet { QLatin1String(File.readAll()) }; + app.setStyleSheet(styleSheet); // Create main window and execute application MainWindow mainWin; diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm/src/mainwindow.cpp /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm/src/mainwindow.cpp --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm/src/mainwindow.cpp 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm/src/mainwindow.cpp 2022-03-04 02:17:30.000000000 +0000 @@ -44,7 +44,7 @@ #include "applicationdialog.h" #include "common.h" - +#include #ifdef Q_OS_MAC #include #endif @@ -60,7 +60,7 @@ iconsPath << QString("%1/../share/icons").arg(qApp->applicationDirPath()); QIcon::setThemeSearchPaths(iconsPath); qDebug() << "using icon theme search path" << QIcon::themeSearchPaths(); - + // libdisks #ifndef NO_UDISKS disks = new Disks(this); @@ -103,18 +103,17 @@ qDebug() << "clear cache"; Common::removeFileCache(); Common::removeFolderCache(); - Common::removeThumbsCache(); settings->setValue("clearCache", false); } - // Dark theme -#ifdef DEPLOY - if (settings->value("darkTheme", true).toBool()) { -#else - if (settings->value("darkTheme").toBool()) { -#endif - qApp->setPalette(Common::darkTheme()); - } + //specify a new font. + QFont newFont("DejaVu Sans", 10, QFont::Normal, false); + //set font of application + QApplication::setFont(newFont); + + // Dark theme only + qApp->setPalette(Common::darkTheme()); + // set icon theme #ifdef Q_OS_MAC @@ -173,6 +172,11 @@ hl1->setSpacing(0); hl1->setContentsMargins(0,0,0,0); detailTree = new QTreeView(page2); + + //this->setStyleSheet("background-color:#555555;"); + detailTree->setAlternatingRowColors(true); + detailTree->setStyleSheet("background-color:#555555;alternate-background-color:#777777;");detailTree->setStyleSheet("QTreeView::item:selected{background-color:#90B2FC;}"); + hl1->addWidget(detailTree); stackWidget->addWidget(page2); @@ -253,7 +257,6 @@ // show window show(); - trashDir = Common::trashDir(); ignoreReload = false; qApp->installEventFilter(this); @@ -392,9 +395,6 @@ connect(detailTree, SIGNAL(pressed(QModelIndex)), this, SLOT(listItemPressed(QModelIndex))); - connect(modelList, SIGNAL(thumbUpdate(QString)), - this, SLOT(thumbUpdate(QString))); - qApp->setKeyboardInputInterval(1000); // Read custom actions @@ -408,7 +408,7 @@ /** * @brief Loads application settings */ -void MainWindow::loadSettings(bool wState, bool hState, bool tabState, bool thumbState) { +void MainWindow::loadSettings(bool wState, bool hState, bool tabState) { // first run? bool isFirstRun = false; @@ -478,11 +478,6 @@ tree->setIconSize(QSize(zoomTree, zoomTree)); bookmarksList->setIconSize(QSize(zoomBook, zoomBook)); - // Load information whether thumbnails can be shown - if (thumbState) { - thumbsAct->setChecked(settings->value("showThumbs", 1).toBool()); - } - // Load view mode detailAct->setChecked(settings->value("viewMode", 0).toBool()); iconAct->setChecked(settings->value("iconMode", 1).toBool()); @@ -543,13 +538,12 @@ modelBookmarks->addBookmark(tr("Applications"), "/Applications", "", "applications-other", "", false, false); #endif modelBookmarks->addBookmark(tr("Home"), QDir::homePath(), "", "user-home", "", false, false); - modelBookmarks->addBookmark(tr("Desktop"), QString("%1/Desktop").arg(QDir::homePath()), "", "user-desktop", "", false, false); + //modelBookmarks->addBookmark(tr("Desktop"), QString("%1/Desktop").arg(QDir::homePath()), "", "user-desktop", "", false, false); //modelBookmarks->addBookmark(tr("Documents"), QString("%1/Documents").arg(QDir::homePath()), "", "text-x-generic", "", false, false); - //modelBookmarks->addBookmark(tr("Downloads"), QString("%1/Dowloads").arg(QDir::homePath()), "", "applications-internet", "", false, false); + modelBookmarks->addBookmark(tr("Downloads"), QString("%1/Downloads").arg(QDir::homePath()), "", "folder-remote", "", false, false); //modelBookmarks->addBookmark(tr("Pictures"), QString("%1/Pictures").arg(QDir::homePath()), "", "image-x-generic", "", false, false); //modelBookmarks->addBookmark(tr("Videos"), QString("%1/Videos").arg(QDir::homePath()), "", "video-x-generic", "", false, false); //modelBookmarks->addBookmark(tr("Music"), QString("%1/Music").arg(QDir::homePath()), "", "audio-x-generic", "", false, false); - modelBookmarks->addBookmark(tr("Trash"), QString("%1/.local/share/Trash").arg(QDir::homePath()), "", "user-trash", "", false, false); modelBookmarks->addBookmark("", "", "", "", "", false, false); writeBookmarks(); } @@ -596,11 +590,6 @@ int childs = settings->childKeys().size(); if (childs>0) { return; } - QVector defActions = Common::getDefaultActions(); - for (int i=0;isetValue(QString(i), defActions.at(i)); - } - settings->endGroup(); settings->sync(); } @@ -692,7 +681,7 @@ } //--------------------------------------------------------------------------- -void MainWindow::dirLoaded(bool thumbs) +void MainWindow::dirLoaded() { if (backIndex.isValid()) { @@ -700,7 +689,6 @@ return; } - qDebug() << "dirLoaded triggered, thumbs?" << thumbs; qint64 bytes = 0; QModelIndexList items; bool includeHidden = hiddenAct->isChecked(); @@ -724,14 +712,12 @@ statusName->clear(); statusSize->setText(QString("%1 items").arg(items.count())); statusDate->setText(QString("%1").arg(total)); - - if (thumbsAct->isChecked() && thumbs) { QtConcurrent::run(modelList,&myModel::loadThumbs,items); } updateGrid(); } void MainWindow::updateDir() { - dirLoaded(false /* dont refresh thumb*/); + dirLoaded(); } void MainWindow::handleReloadDir(const QString &path) @@ -747,13 +733,6 @@ QTimer::singleShot(500, this, SLOT(enableReload())); } -void MainWindow::thumbUpdate(const QString &path) -{ - qDebug() << "thumbupdate" << path << modelList->getRootPath(); - if (path != modelList->getRootPath()) { return; } - refresh(false, false); -} - //--------------------------------------------------------------------------- void MainWindow::listSelectionChanged(const QItemSelection selected, const QItemSelection deselected) { @@ -1283,7 +1262,6 @@ settings->setValue("zoomDetail", zoomDetail); settings->setValue("sortBy", currentSortColumn); settings->setValue("sortOrder", currentSortOrder); - settings->setValue("showThumbs", thumbsAct->isChecked()); settings->setValue("hiddenMode", hiddenAct->isChecked()); settings->setValue("lockLayout", lockLayoutAct->isChecked()); settings->setValue("tabsOnTop", tabsOnTopAct->isChecked()); @@ -1325,7 +1303,7 @@ qDebug() << "TOOLBAR"; return; } - + QToolButton *isToolButton = dynamic_cast(childAt(event->pos())); if (isToolButton) { qDebug() << "TOOLBUTTON"; @@ -1340,6 +1318,13 @@ } #endif + // get selected list so we can track if motre than one item is selected - if (selList.count() == 1) + // some menu items will nnot be activew if more than one item is selected + QModelIndexList selList; + if (listSelectionModel->selectedRows(0).count()) { + selList = listSelectionModel->selectedRows(0); } + else { selList = listSelectionModel->selectedIndexes(); } + // Continue with poups for folders and files QList actions; popup = new QMenu(this); @@ -1375,6 +1360,7 @@ } else { popup->addAction(openAct); } + // Add open action /*foreach (QAction* action, actions) { @@ -1389,8 +1375,12 @@ popup->addSeparator(); popup->addMenu(createOpenWithMenu()); #endif - //if (popup->actions().count() == 0) popup->addAction(openAct); + // Open a file as text + if (selList.count() == 1) { + popup->addAction(textAct); + } + // Add custom actions that are associated only with this file type if (!actions.isEmpty()) { popup->addSeparator(); @@ -1408,12 +1398,17 @@ // Add cut/copy/paste/rename actions popup->addSeparator(); + + if (selList.count() == 1) { + popup->addAction(copypathAct); + popup->addAction(renameAct); + } + popup->addSeparator(); popup->addAction(cutAct); popup->addAction(copyAct); popup->addAction(pasteAct); popup->addSeparator(); - popup->addAction(renameAct); - popup->addSeparator(); + // Add custom actions that are associated with all file types foreach (QMenu* parent, customActManager->getMenus()->values("*")) { @@ -1424,9 +1419,6 @@ if (customActManager->getActionList()->size()>0) { popup->addSeparator(); } - if (modelList->getRootPath() != trashDir) { - popup->addAction(trashAct); - } popup->addAction(deleteAct); popup->addSeparator(); actions = customActManager->getActions()->values(curIndex.path()); //children of $parent @@ -1438,26 +1430,31 @@ // Folder/directory else { //popup->addAction(openAct); + if (curIndex.absoluteFilePath().endsWith(".mount")){ + popup->addAction(unmountAct); + } popup->addAction(openInTabAct); popup->addSeparator(); popup->addAction(addBookmarkAct); + + if (selList.count() == 1) { + popup->addAction(compressDirAct); + popup->addAction(copypathAct); + popup->addAction(renameAct); + } + popup->addSeparator(); popup->addAction(cutAct); popup->addAction(copyAct); popup->addAction(pasteAct); popup->addSeparator(); - popup->addAction(renameAct); - popup->addSeparator(); - + foreach (QMenu* parent, customActManager->getMenus()->values("*")) { popup->addMenu(parent); } actions = customActManager->getActions()->values("*"); popup->addActions(actions); - if (modelList->getRootPath() != trashDir) { - popup->addAction(trashAct); - } popup->addAction(deleteAct); popup->addSeparator(); @@ -1541,16 +1538,17 @@ popup->addAction(newFileAct); popup->addAction(newWinAct); popup->addAction(openTabAct); + popup->addAction(findAct); popup->addSeparator(); + if (selList.count() == 1) { + popup->addAction(copypathAct); + popup->addAction(renameAct); + } + popup->addSeparator(); popup->addAction(cutAct); popup->addAction(copyAct); popup->addAction(pasteAct); popup->addSeparator(); - popup->addAction(renameAct); - popup->addSeparator(); - if (modelList->getRootPath() != trashDir) { - popup->addAction(trashAct); - } popup->addAction(deleteAct); } popup->addSeparator(); diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm/src/mainwindow.h /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm/src/mainwindow.h --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm/src/mainwindow.h 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm/src/mainwindow.h 2022-02-27 01:30:27.000000000 +0000 @@ -92,7 +92,6 @@ void goBackDir(); void goHomeDir(); void deleteFile(); - void trashFile(); void cutFile(); void copyFile(); bool cutCopyFile(const QString &source, QString dest, qint64 totalSize, bool cut); @@ -102,6 +101,11 @@ void newFile(); void pathEditChanged(QString); void terminalRun(); + void aroxRun(); + void compressDir(); + void openASTEXT(); + void unMount(); + void findRun(); void executeFile(QModelIndex, bool); void runFile(); void openFile(); @@ -113,7 +117,6 @@ void toggleSortOrder(); void setSortOrder(Qt::SortOrder order); void setSortColumn(QAction *columnAct); - void toggleThumbs(); void addBookmarkAction(); void addSeparatorAction(); void delBookmark(); @@ -122,6 +125,7 @@ void showEditDialog(); bool copyFolder(const QString &srcFolder, const QString &dstFolder, qint64, bool); void renameFile(); + void copyPath(); void actionMapper(QString); void folderPropertiesLauncher(); void bookmarkClicked(QModelIndex); @@ -148,12 +152,11 @@ void focusAction(); void openFolderAction(); void exitAction(); - void dirLoaded(bool thumbs = true); + void dirLoaded(); void updateDir(); void handleReloadDir(const QString &path); - void thumbUpdate(const QString &path); void addressChanged(int,int); - void loadSettings(bool wState = true, bool hState = true, bool tabState = true, bool thumbState = true); + void loadSettings(bool wState = true, bool hState = true, bool tabState = true); void firstRunBookmarks(bool isFirstRun); void loadBookmarks(); void writeBookmarks(); @@ -257,6 +260,9 @@ QAction *upAct; QAction *backAct; QAction *homeAct; + QAction *aroxAct; + QAction *textAct; + QAction *unmountAct; QAction *newTabAct; QAction *hiddenAct; QAction *filterAct; @@ -277,13 +283,14 @@ QAction *newFileAct; QAction *cutAct; QAction *copyAct; + QAction *compressDirAct; QAction *pasteAct; QAction *settingsAct; QAction *renameAct; + QAction *copypathAct; QAction *terminalAct; QAction *openAct; QAction *runAct; - QAction *thumbsAct; QAction *folderPropertiesAct; QAction *lockLayoutAct; //QAction *escapeAct; @@ -296,6 +303,7 @@ QAction *focusListAct; QAction *openFolderAct; QAction *newWinAct; + QAction *findAct; QAction *openTabAct; QAction *openInTabAct; QAction *closeTabAct; @@ -306,13 +314,11 @@ QAction *mediaUnmountAct; QAction *mediaEjectAct; #endif - QAction *trashAct; QAction *clearCacheAct; // libdisks #ifndef NO_UDISKS Disks *disks; #endif - QString trashDir; #ifndef NO_DBUS qtfm *service; diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm/src/settingsdialog.cpp /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm/src/settingsdialog.cpp --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm/src/settingsdialog.cpp 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm/src/settingsdialog.cpp 2022-02-24 07:10:03.000000000 +0000 @@ -183,9 +183,6 @@ #ifndef Q_OS_MAC cmbIconTheme = new QComboBox(grpAppear); #endif -#if QT_VERSION >= 0x050000 - checkDarkTheme = new QCheckBox(grpAppear); -#endif checkWindowTitlePath = new QCheckBox(grpAppear); checkFileColor = new QCheckBox(grpAppear); showHomeButton = new QCheckBox(grpAppear); @@ -195,9 +192,6 @@ #ifndef Q_OS_MAC layoutAppear->addRow(tr("Fallback Icon theme:"), cmbIconTheme); #endif -#if QT_VERSION >= 0x050000 - layoutAppear->addRow(tr("Use \"Dark Mode\""), checkDarkTheme); -#endif layoutAppear->addRow(tr("Colors on file names"), checkFileColor); layoutAppear->addRow(tr("Show path in window title"), checkWindowTitlePath); layoutAppear->addRow(tr("Show Home button"), showHomeButton); @@ -383,6 +377,7 @@ QGroupBox* grpDMime = new QGroupBox(tr("Default mime applications"), widget); QFormLayout* layoutDMime = new QFormLayout(grpDMime); cmbDefaultMimeApps = new QComboBox(grpDMime); + cmbDefaultMimeApps->addItem("/usr/share/applications/mimeapps.list"); cmbDefaultMimeApps->addItem("/.local/share/applications/mimeapps.list"); cmbDefaultMimeApps->addItem("/.local/share/applications/defaults.list"); cmbDefaultMimeApps->addItem("/.config/mimeapps.list"); @@ -692,13 +687,7 @@ showHomeButton->setChecked(settingsPtr->value("home_button", true).toBool()); showNewTabButton->setChecked(settingsPtr->value("newtab_button", false).toBool()); showTerminalButton->setChecked(settingsPtr->value("terminal_button", true).toBool()); -#if QT_VERSION >= 0x050000 -#ifdef DEPLOY - checkDarkTheme->setChecked(settingsPtr->value("darkTheme", true).toBool()); -#else - checkDarkTheme->setChecked(settingsPtr->value("darkTheme", false).toBool()); -#endif -#endif + checkFileColor->setChecked(settingsPtr->value("fileColor", false).toBool()); checkPathHistory->setChecked(settingsPtr->value("pathHistory", true).toBool()); checkWindowTitlePath->setChecked(settingsPtr->value("windowTitlePath", true).toBool()); @@ -937,16 +926,9 @@ QMessageBox::warning(this, tr("Restart to apply settings"), tr("You must restart application to apply theme settings")); } #endif - -#if QT_VERSION >= 0x050000 - if (checkDarkTheme->isChecked() != settingsPtr->value("darkTheme").toBool()) { - QMessageBox::warning(this, tr("Restart to apply settings"), tr("You must restart application to apply theme settings")); - } - settingsPtr->setValue("darkTheme", checkDarkTheme->isChecked()); -#endif settingsPtr->setValue("fileColor", checkFileColor->isChecked()); settingsPtr->setValue("pathHistory", checkPathHistory->isChecked()); - + // Custom actions settingsPtr->setValue("showActionOutput", checkOutput->isChecked()); @@ -1108,14 +1090,6 @@ void SettingsDialog::clearCustomAction() { actionsWidget->clear(); - QVector defActions = Common::getDefaultActions(); - for (int i=0;isetFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled - | Qt::ItemIsDragEnabled | Qt::ItemIsUserCheckable); - item->setCheckState(3, Qt::Unchecked); - item->setIcon(2, QIcon::fromTheme(defActions.at(i).at(2))); - } readShortcuts(); } //--------------------------------------------------------------------------- diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm/src/settingsdialog.h /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm/src/settingsdialog.h --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm/src/settingsdialog.h 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm/src/settingsdialog.h 2022-02-24 02:07:08.000000000 +0000 @@ -79,7 +79,6 @@ QCheckBox* showTerminalButton; QCheckBox* showHomeButton; QCheckBox* showNewTabButton; - QCheckBox* checkDarkTheme; QCheckBox* checkFileColor; QCheckBox* checkPathHistory; QTreeWidget *actionsWidget; diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm7/qtfm.cpp /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm7/qtfm.cpp --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm7/qtfm.cpp 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm7/qtfm.cpp 2022-02-24 02:07:08.000000000 +0000 @@ -20,6 +20,7 @@ , backButton(Q_NULLPTR) , upButton(Q_NULLPTR) , homeButton(Q_NULLPTR) + , aroxButton(Q_NULLPTR) , tileButton(Q_NULLPTR) { QIcon::setThemeSearchPaths(Common::iconPaths(qApp->applicationDirPath())); @@ -63,6 +64,9 @@ homeButton = new QPushButton(this); homeButton->setText(tr("Home")); + aroxButton = new QPushButton(this); + aroxButton->setText(tr("Open in Arox")); + tileButton = new QPushButton(this); tileButton->setText(tr("Tile")); diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm7/qtfm.h /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm7/qtfm.h --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/fm7/qtfm.h 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/fm7/qtfm.h 2022-02-24 02:07:08.000000000 +0000 @@ -41,6 +41,7 @@ QPushButton *backButton; QPushButton *upButton; QPushButton *homeButton; + QPushButton *aroxButton; QPushButton *tileButton; public slots: diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/libfm/common.cpp /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/libfm/common.cpp --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/libfm/common.cpp 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/libfm/common.cpp 2022-02-26 06:24:42.000000000 +0000 @@ -52,16 +52,6 @@ .arg(FM_MAJOR); } -QString Common::trashDir() -{ - QString dir = QString("%1/.local/share/Trash").arg(QDir::homePath()); - if (!QFile::exists(dir)) { - QDir makedir(dir); - if (!makedir.mkpath(dir)) { dir.clear(); } - } - return dir; -} - QStringList Common::iconLocations(QString appPath) { QStringList result; @@ -388,15 +378,6 @@ return false; } -bool Common::removeThumbsCache() -{ - QFile cache(QString("%1/thumbs.cache").arg(Common::configDir())); - if (cache.exists()) { - return cache.remove(); - } - return false; -} - void Common::setupIconTheme(QString appFilePath) { QString temp = QIcon::themeName(); @@ -574,23 +555,6 @@ return iconsPath; } -QVector Common::getDefaultActions() -{ - QVector result; - result.append(QStringList()<< "tar.gz,tar.bz2,tar.xz,tar,tgz,tbz,tbz2,txz" << "Extract tar here ..." << "package-x-generic" << "tar xvf %f"); - result.append(QStringList()<< "7z" << "Extract 7z here ..." << "package-x-generic" << "7za x %f"); - result.append(QStringList()<< "rar" << "Extract rar here ..." << "package-x-generic" << "unrar x %f"); - result.append(QStringList()<< "zip" << "Extract zip here ..." << "package-x-generic" << "unzip %f"); - result.append(QStringList()<< "gz" << "Extract gz here ..." << "package-x-generic" << "gunzip --keep %f"); - result.append(QStringList()<< "bz2" << "Extract bz2 here ..." << "package-x-generic" << "bunzip2 --keep %f"); - result.append(QStringList()<< "xz" << "Extract xz here ..." << "package-x-generic" << "xz -d --keep %f"); - result.append(QStringList()<< "*" << "Compress to tar.gz" << "package-x-generic" << "tar cvvzf %n.tar.gz %f"); - result.append(QStringList()<< "*" << "Compress to tar.bz2" << "package-x-generic" << "tar cvvjf %n.tar.bz2 %f"); - result.append(QStringList()<< "*" << "Compress to tar.xz" << "package-x-generic" << "tar cvvJf %n.tar.xz %f"); - result.append(QStringList()<< "*" << "Compress to zip" << "package-x-generic" << "zip -r %n.zip %f"); - return result; -} - QString Common::formatSize(qint64 num) { QString total; diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/libfm/common.h /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/libfm/common.h --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/libfm/common.h 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/libfm/common.h 2022-02-26 06:25:24.000000000 +0000 @@ -38,7 +38,7 @@ #define BOOKMARK_ICON Qt::UserRole+2 #define BOOKMARKS_AUTO Qt::UserRole+3 -#define MIME_APPS "/.local/share/applications/mimeapps.list" +#define MIME_APPS "/.config/mimeapps.list" #define COPY_X_OF "Copy (%1) of %2" #define COPY_X_TS "yyyyMMddHHmmss" @@ -54,7 +54,6 @@ }; static QString configDir(); static QString configFile(); - static QString trashDir(); static QStringList iconLocations(QString appPath); static QStringList pixmapLocations(QString appPath); static QStringList applicationLocations(QString appPath); @@ -84,7 +83,6 @@ static QStringList getIconThemes(QString appPath); static bool removeFileCache(); static bool removeFolderCache(); - static bool removeThumbsCache(); static void setupIconTheme(QString appFilePath); static DragMode int2dad(int value); static QVariant readSetting(QString key, @@ -98,7 +96,6 @@ static QString getDeviceForDir(QString dir); static QPalette darkTheme(); static QStringList iconPaths(QString appPath); - static QVector getDefaultActions(); static QString formatSize(qint64 num); static QString getDriveInfo(QString path); }; diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/libfm/mymodel.cpp /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/libfm/mymodel.cpp --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/libfm/mymodel.cpp 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/libfm/mymodel.cpp 2022-02-24 02:07:08.000000000 +0000 @@ -56,7 +56,6 @@ mimeGlob = new QHash; mimeIcons = new QHash; folderIcons = new QHash; - thumbs = new QHash; icons = new QCache; icons->setMaxCost(500); @@ -112,7 +111,6 @@ delete mimeGlob; delete mimeIcons; delete folderIcons; - delete thumbs; delete icons; delete rootItem; delete iconFactory; @@ -347,9 +345,6 @@ inotify_rm_watch(inotifyFD,eventID); watchers.remove(eventID); } - if (!fileName.isEmpty() && showThumbs) { - lastEventFilename = fileName; - } if (!folderChanged.isEmpty()) { qDebug() << "folder modified" << folderChanged; emit reloadDir(folderChanged); @@ -577,31 +572,7 @@ out << *folderIcons; fileIcons.close(); } - - if(thumbs->count() > thumbCount) { - fileIcons.setFileName(QString("%1/thumbs.cache").arg(Common::configDir())); - if(fileIcons.size() > 10000000) { fileIcons.remove(); } - else { - if (fileIcons.open(QIODevice::WriteOnly)) { - QDataStream out(&fileIcons); - out.setDevice(&fileIcons); - out << *thumbs; - fileIcons.close(); - } - } - } -} - -//--------------------------------------------------------------------------- - -/** - * @brief Sets indicator wthether show thumbnails of pictures - * @param icons - */ -void myModel::setMode(bool icons) { - showThumbs = icons; } -//--------------------------------------------------------------------------- /** * @brief Loads mime types @@ -618,461 +589,10 @@ mimeGeneric->insert(generic.key(), generic.value()); } } -//--------------------------------------------------------------------------- - -/** - * @brief Loads thumbnails - * @param indexes - */ -void myModel::loadThumbs(QModelIndexList indexes) { - - // Types that should be thumbnailed - QStringList files; - - // Remember files with valid mime - foreach (QModelIndex item, indexes) { - QString filename = filePath(item); - QString mimetype = mimeUtilsPtr->getMimeType(filename); - //qDebug() << "mime for file" << filename << mimetype; - if (mimetype.startsWith(QString("image")) -#ifdef WITH_MAGICK - || mimetype == QString("application/pdf") -#ifdef WITH_FFMPEG - || mimetype.startsWith(QString("video")) - || mimetype == QString("audio/mpeg") -#endif -#endif - || filename.endsWith(".desktop") - ) - { files.append(filename); } - } - - // Loads thumbnails from cache - if (files.count()) { - QFileInfo pathInfo (files.at(0)); - if (thumbs->count() == 0) { - qDebug() << "thumbs are empty, try to load cache ..."; - QFile fileIcons(QString("%1/thumbs.cache").arg(Common::configDir())); - if (fileIcons.open(QIODevice::ReadOnly)) { - qDebug() << "load thumbs from cache ..."; - QDataStream out(&fileIcons); - out >> *thumbs; - fileIcons.close(); - } - thumbCount = thumbs->count(); - qDebug() << "thumbcount" << thumbCount; - } - - foreach (QString item, files) { - if (!thumbs->contains(item) || - (item.split("/").takeLast() == lastEventFilename && !lastEventFilename.isEmpty())) - { - qDebug() << "gen new thumb" << item; - QByteArray thumb = getThumb(item); - if (thumb.size()>0) { - thumbs->insert(item, thumb); - if (item.split("/").takeLast() == lastEventFilename) { - qDebug() << "save new thumb cache"; - lastEventFilename.clear(); - QFile fileIcons(QString("%1/thumbs.cache").arg(Common::configDir())); - if(fileIcons.size() > 10000000) { fileIcons.remove(); } - else { - if (fileIcons.open(QIODevice::WriteOnly)) { - QDataStream out(&fileIcons); - out.setDevice(&fileIcons); - out << *thumbs; - fileIcons.close(); - } - } - } - } - } - } - emit thumbUpdate(pathInfo.absolutePath()); - } -} //--------------------------------------------------------------------------- /** - * @brief Creates thumbnail for given item - * @param item - * @return thumbnail - */ -QByteArray myModel::getThumb(QString item) { - - if (item.isEmpty()) { return QByteArray(); } - if (item.endsWith(".desktop")) { - QString iconFile = Common::findIcon("", QIcon::themeName(), Common::getDesktopIcon(item)); - if (!iconFile.isEmpty()) { - QPixmap pix = QPixmap::fromImage(QImage(iconFile)); - if (!pix.isNull()) { - QByteArray raw; - QBuffer buffer(&raw); - buffer.open(QIODevice::WriteOnly); - pix.save(&buffer, "PNG"); - return raw; - } - } - return QByteArray(); - } -#ifdef WITH_MAGICK -#ifdef WITH_FFMPEG - QString itemMime = mimeUtilsPtr->getMimeType(item); - if (itemMime.startsWith(QString("video"))) { - QByteArray coverart = getVideoFrame(item, true); - if (coverart.size()>0) { return coverart; } - return getVideoFrame(item, false); - } else if (itemMime == QString("audio/mpeg")) { - return getVideoFrame(item, true); - } -#endif - QByteArray result; - qDebug() << "generate thumbnail for" << item; - try { - Magick::Image background(Magick::Geometry(128, 128), Magick::ColorRGB(0, 0, 0)); -#ifndef OLDMAGICK - background.quiet(true); -#endif -#if MagickLibVersion >= 0x700 - background.alpha(true); -#else - background.matte(true); -#endif - background.backgroundColor(background.pixelColor(0,0)); - background.transparent(background.pixelColor(0,0)); - - Magick::Image thumb; -#ifndef OLDMAGICK - thumb.quiet(true); -#endif - QString filename = item; - thumb.read(filename.toUtf8().data()); - thumb.scale(Magick::Geometry(128, 128)); - if (thumb.depth()>8) { thumb.depth(8); } - int offsetX = 0; - int offsetY = 0; - if (thumb.columns() 128 || h > 128) { - pic.setScaledSize(QSize(123, 93)); - QImage temp = pic.read(); - theThumb.load(":/images/background.png"); - QPainter painter(&theThumb); - painter.drawImage(QPoint(0, 0), temp); - } else { - pic.setScaledSize(QSize(64, 64)); - theThumb = pic.read(); - } - - // Draw thumbnail picture - QPainter painter(&background); - painter.drawImage(QPoint((123 - theThumb.width()) / 2, - (115 - theThumb.height()) / 2), theThumb); - - // Write it to buffer - QBuffer buffer; - QImageWriter writer(&buffer, "jpg"); - writer.setQuality(50); - writer.write(background); - return buffer.buffer(); -#endif -} - -#ifdef WITH_FFMPEG -QByteArray myModel::getVideoFrame(QString file, bool getEmbedded, int videoFrame, int pixSize) -{ - qDebug() << "getVideoFrame" << file << getEmbedded << videoFrame << pixSize; - QByteArray result; - if (file.isEmpty()) { return result; } - - AVCodecContext *pCodecCtx; - AVFormatContext *pFormatCtx = avformat_alloc_context(); - AVCodec * pCodec; - AVFrame *pFrame, *pFrameRGB; - - qDebug() << "open media file"; - if (avformat_open_input(&pFormatCtx,file.toUtf8().data(), - Q_NULLPTR, - Q_NULLPTR) != 0) { return result; } - if (avformat_find_stream_info(pFormatCtx, - Q_NULLPTR) < 0) { return result; } - - av_dump_format(pFormatCtx, 0, file.toUtf8().data(), 0); - int videoStream = -1; - int possibleVideoCover = -1; - - qDebug() << "get video stream"; - for (int i=0; i < (int)pFormatCtx->nb_streams; i++) { - if(pFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { - if (pFormatCtx->streams[i]->codecpar->codec_id == AV_CODEC_ID_MJPEG || - pFormatCtx->streams[i]->codecpar->codec_id == AV_CODEC_ID_PNG || - pFormatCtx->streams[i]->codecpar->codec_id == AV_CODEC_ID_GIF || - pFormatCtx->streams[i]->codecpar->codec_id == AV_CODEC_ID_TIFF || - pFormatCtx->streams[i]->codecpar->codec_id == AV_CODEC_ID_BMP) { - possibleVideoCover = i; - } - if (videoStream<0) { videoStream = i; } - //break; - } - } - if (possibleVideoCover>-1 && getEmbedded) { - qDebug() << "FOUND COVER?"; - videoStream = possibleVideoCover; - } - if (videoStream == -1) { return result; } - - qDebug() << "find decoder"; - pCodec =avcodec_find_decoder(pFormatCtx->streams[videoStream]->codecpar->codec_id); - pCodecCtx = avcodec_alloc_context3(Q_NULLPTR); - if (pCodec == Q_NULLPTR || pCodecCtx == Q_NULLPTR) { return result; } - if (avcodec_parameters_to_context(pCodecCtx, - pFormatCtx->streams[videoStream]->codecpar)<0) - { return result; } - if (avcodec_open2(pCodecCtx, - pCodec, - Q_NULLPTR) < 0) { return result; } - - qDebug() << "check for embedded?" << getEmbedded; - if (getEmbedded) { - if (pFormatCtx->streams[videoStream]->disposition == AV_DISPOSITION_ATTACHED_PIC) { - AVPacket pkt = pFormatCtx->streams[videoStream]->attached_pic; - if (pkt.size>0) { - QByteArray attachedPix = QByteArray(reinterpret_cast(pkt.data), - pkt.size); - if (attachedPix.length()>0) { - qDebug() << "got embedded picture"; - avcodec_close(pCodecCtx); - avformat_close_input(&pFormatCtx); - //return attachedPix; - - - qDebug() << "prepare thumbnail for" << file; - try { - Magick::Image thumb(Magick::Blob(attachedPix, attachedPix.length())); - - Magick::Image background(Magick::Geometry((size_t)pixSize, - (size_t)pixSize), - Magick::Color("black")); -#if MagickLibVersion >= 0x700 - background.alpha(true); -#else - background.matte(true); -#endif - background.backgroundColor(background.pixelColor(0,0)); - background.transparent(background.pixelColor(0,0)); - - thumb.scale(Magick::Geometry((size_t)pixSize, - (size_t)pixSize)); - int offsetX = 0; - int offsetY = 0; - if (thumb.columns()width, - pCodecCtx->height, - 16); - buffer = (uint8_t *) av_malloc(numBytes*sizeof(uint8_t)); - av_image_fill_arrays(pFrameRGB->data, - pFrameRGB->linesize, - buffer, - pFormat, - pCodecCtx->width, - pCodecCtx->height, - 1); - - qDebug() << "calculate frame to get"; - int res; - int frameFinished; - AVPacket packet; - int currentFrame = 0; - bool fetchFrame = false; - double fps = av_q2d(pFormatCtx->streams[videoStream]->r_frame_rate); - double dur = static_cast(pFormatCtx->duration)/AV_TIME_BASE; - int maxFrame = qRound((dur*fps)/2); - if (videoFrame>=0) { maxFrame = videoFrame; } - - qDebug() << "we need to get frame" << maxFrame; - int64_t seekT = (int64_t(maxFrame) * - pFormatCtx->streams[videoStream]->r_frame_rate.den * - pFormatCtx->streams[videoStream]->time_base.den) / - (int64_t(pFormatCtx->streams[videoStream]->r_frame_rate.num) * - pFormatCtx->streams[videoStream]->time_base.num); - if (av_seek_frame(pFormatCtx, videoStream, seekT, AVSEEK_FLAG_FRAME) >= 0) { - av_init_packet(&packet); - currentFrame = maxFrame; - } - while((res = av_read_frame(pFormatCtx,&packet)>=0)) { - qDebug() << "at current frame" << currentFrame; - if (currentFrame>=maxFrame) { fetchFrame = true; } - if (packet.stream_index == videoStream){ - if (!fetchFrame) { - currentFrame++; - continue; - } - - qDebug() << "get frame" << currentFrame; - int ret = avcodec_send_packet(pCodecCtx, &packet); - if (ret<0) { continue; } - ret = avcodec_receive_frame(pCodecCtx, pFrame); - if (ret>=0) { frameFinished = true; } - else { continue; } - - if (frameFinished) { - qDebug() << "extract image from frame" << currentFrame; - struct SwsContext * img_convert_ctx; - img_convert_ctx = sws_getCachedContext(Q_NULLPTR, - pCodecCtx->width, - pCodecCtx->height, - pCodecCtx->pix_fmt, - pCodecCtx->width, - pCodecCtx->height, - AV_PIX_FMT_BGR24, - SWS_BICUBIC, - Q_NULLPTR, - Q_NULLPTR, - Q_NULLPTR); - sws_scale(img_convert_ctx, - ((AVFrame*)pFrame)->data, - ((AVFrame*)pFrame)->linesize, - 0, - pCodecCtx->height, - ((AVFrame*)pFrameRGB)->data, - ((AVFrame*)pFrameRGB)->linesize); - - qDebug() << "prepare thumbnail for" << file; - try { - Magick::Image background(Magick::Geometry((size_t)pixSize, - (size_t)pixSize), - Magick::Color("black")); -#if MagickLibVersion >= 0x700 - background.alpha(true); -#else - background.matte(true); -#endif - background.backgroundColor(background.pixelColor(0,0)); - background.transparent(background.pixelColor(0,0)); - - Magick::Image thumb((size_t)pFrame->width, - (size_t)pFrame->height, - "BGR", - Magick::CharPixel, - pFrameRGB->data[0]); - thumb.scale(Magick::Geometry((size_t)pixSize, - (size_t)pixSize)); - int offsetX = 0; - int offsetY = 0; - if (thumb.columns()contains(item->absoluteFilePath())) { - return *icons->object(item->absoluteFilePath()); - } else*/ if (thumbs->contains(item->absoluteFilePath())) { - QPixmap pic; - pic.loadFromData(thumbs->value(item->absoluteFilePath())); - icons->insert(item->absoluteFilePath(), new QIcon(pic), 1); - return *icons->object(item->absoluteFilePath()); - } - } - // NOTE: Suffix is resolved using method getRealSuffix instead of suffix() // method. It is because files can contain version suffix e.g. .so.1.0.0 diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/libfm/mymodel.h /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/libfm/mymodel.h --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/libfm/mymodel.h 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/libfm/mymodel.h 2022-02-24 02:07:08.000000000 +0000 @@ -42,7 +42,6 @@ void loadMimeTypes() const; void cacheInfo(); void setMode(bool); - void loadThumbs(QModelIndexList); void addCutItems(QStringList); void populateItem(myModelItem *item); void fetchMore(const QModelIndex & parent); @@ -69,7 +68,6 @@ QString filePath(const QModelIndex &index); QString getMimeType(const QModelIndex &index); QStringList mimeTypes() const; - QByteArray getThumb(QString item); #ifdef WITH_FFMPEG QByteArray getVideoFrame(QString file, bool getEmbedded = false, int videoFrame = -1, int pixSize = 128); #endif @@ -91,7 +89,6 @@ signals: void dragDropPaste(const QMimeData *data, QString newPath, Common::DragMode mode = Common::DM_UNKNOWN); - void thumbUpdate(const QString &path); void reloadDir(const QString &path); protected: QVariant data(const QModelIndex & index, int role) const; @@ -104,14 +101,11 @@ QVariant findMimeIcon(myModelItem *item) const; private: bool realMimeTypes; - bool showThumbs; - int thumbCount; QPalette colors; QStringList cutItems; QHash *mimeGlob; QHash *mimeGeneric; - QHash *thumbs; myModelItem* rootItem; MimeUtils* mimeUtilsPtr; diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/libfm/udisks2.cpp /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/libfm/udisks2.cpp --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/libfm/udisks2.cpp 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/libfm/udisks2.cpp 2022-02-24 02:07:08.000000000 +0000 @@ -226,7 +226,7 @@ // https://bugs.archlinux.org/task/49643 // https://bugs.freedesktop.org/show_bug.cgi?id=52357 QProcess proc; - proc.start(QString("udisks --mount /dev/%1").arg(path.split("/").takeLast())); + proc.start(QString("udisksctl mount -b /dev/%1").arg(path.split("/").takeLast())); proc.waitForFinished(); return QString(); } @@ -249,7 +249,7 @@ // https://bugs.archlinux.org/task/49643 // https://bugs.freedesktop.org/show_bug.cgi?id=52357 QProcess proc; - proc.start(QString("udisks --unmount /dev/%1").arg(path.split("/").takeLast())); + proc.start(QString("udisksctl unmount -b /dev/%1").arg(path.split("/").takeLast())); proc.waitForFinished(); return QString(); } diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/share/qtfm.pri /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/share/qtfm.pri --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/share/qtfm.pri 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/share/qtfm.pri 2022-02-24 02:07:08.000000000 +0000 @@ -11,7 +11,7 @@ unix:!macx { isEmpty(PREFIX) { - PREFIX = /usr/local + PREFIX = /usr isEmpty(XDGDIR): XDGDIR = $${PREFIX}/etc/xdg } isEmpty(LIBDIR): LIBDIR = $$PREFIX/lib$${LIBSUFFIX} diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/share/qtfm.qrc /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/share/qtfm.qrc --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/share/qtfm.qrc 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/share/qtfm.qrc 2022-02-28 19:47:05.000000000 +0000 @@ -1,34 +1,43 @@ - images/back.png - images/bookmark.png - images/clear.png - images/copy.png - images/cut.png - images/delete.png - images/details.png - images/document-new.png - images/document-open.png - images/exit.png - images/folder-new.png - images/hidden.png - images/home.png - images/icons.png - images/key_bindings.png - images/lock.png - images/paste.png - images/refresh.png - images/sep.png - images/terminal.png - images/up.png - images/window-close.png - images/zoom-in.png - images/zoom-out.png - images/preferences.png - images/properties.png - images/background.png - images/user-trash.png - images/qtfm.png + images/arox.png + images/back.png + images/background.png + images/bookmark.png + images/clear.png + images/copy.png + images/cut.png + images/delete.png + images/details.png + images/document-new.png + images/document-open.png + images/exit.png + images/find.png + images/folder-new.png + images/hidden.png + images/home.png + images/icons.png + images/key_bindings.png + images/lock.png + images/paste.png + images/preferences.png + images/properties.png + images/qtfm.png + images/refresh.png + images/sep.png + images/terminal.png + images/to-clipboard.png + images/unmount.png + images/up.png + images/user-trash.png + images/window-close.png + images/zoom-in.png + images/zoom-out.png + images/scite.png + images/arox-compress.png ../AUTHORS + ../absolute.qss + images/arrow_up.png + images/arrow_down.png diff -Naur /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/tray/systray.cpp /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/tray/systray.cpp --- /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1/tray/systray.cpp 2021-05-30 15:03:24.000000000 +0000 +++ /usr/src/repo/builds_15/qtFM_BUILD/qtfm-6.2.1_edited10/tray/systray.cpp 2022-02-24 02:07:08.000000000 +0000 @@ -31,6 +31,8 @@ #include #include #include +#include +#include SysTray::SysTray(QObject *parent) : QObject(parent) @@ -46,7 +48,7 @@ menu = new QMenu(); - disktray = new QSystemTrayIcon(QIcon::fromTheme("drive-removable-media", + disktray = new QSystemTrayIcon(QIcon::fromTheme("drive", QIcon(":/icons/drive-removable-media.png")), this); disktray->setToolTip(tr("Removable Devices")); @@ -148,9 +150,9 @@ bool hasAudio = device.value()->opticalAudioTracks>0?true:false; bool hasData = device.value()->opticalDataTracks>0?true:false; if (device.value()->isBlankDisc || - (hasAudio && !hasData)) { deviceAction->setIcon(QIcon::fromTheme("media-eject", + (hasAudio && !hasData)) { deviceAction->setIcon(QIcon::fromTheme("my-eject", QIcon(":/icons/media-eject.png"))); } - } else { deviceAction->setIcon(QIcon::fromTheme("media-eject", + } else { deviceAction->setIcon(QIcon::fromTheme("my-eject", QIcon(":/icons/media-eject.png"))); } } @@ -229,17 +231,15 @@ QObject::tr("Detected %1 media in %2") .arg(opticalType) .arg(man->devices[path]->name)); - - bool openMedia = false; // auto mount if enabled if (Common::readSetting("trayAutoMount").toBool() && isData) { - qDebug() << "auto mount optical"; - man->devices[path]->mount(); - openMedia = true; + man->devices[path]->mount(); + openMountpoint(man->devices[path]->mountpoint); + generateContextMenu(); + return; } // auto play CD if enabled if (Common::readSetting("autoPlayAudioCD").toBool() && isAudio) { - openMedia = false; QStringList apps = mimeUtilsPtr->getDefault("x-content/audio-cdda"); QString desktop = Common::findApplication(qApp->applicationFilePath(), apps.at(0)); if (desktop.isEmpty()) { return; } @@ -249,55 +249,35 @@ QProcess::startDetached(QString("%1 cdda://%2") .arg(app) .arg(man->devices[path]->mountpoint)); + generateContextMenu(); + return; } // auto play DVD if enabled if (Common::readSetting("autoPlayDVD").toBool() && isData) { if (man->devices[path]->mountpoint.isEmpty()) { man->devices[path]->mount(); } - openMedia = false; - QDir tsVideo(QString("%1/video_ts") - .arg(man->devices[path]->mountpoint)); - QDir tsAudio(QString("%1/audio_ts") - .arg(man->devices[path]->mountpoint)); - if (!tsVideo.exists()) { - tsVideo.setPath(QString("%1/VIDEO_TS") - .arg(man->devices[path]->mountpoint)); - } - if (!tsAudio.exists()) { - tsAudio.setPath(QString("%1/AUDIO_TS") - .arg(man->devices[path]->mountpoint)); - } - QString desktop; - if (tsVideo.exists()) { - QStringList apps = mimeUtilsPtr->getDefault("x-content/video-dvd"); - qDebug() << "video dvd apps" << apps; - desktop = Common::findApplication(qApp->applicationFilePath(), - apps.at(0)); - } else if (!tsVideo.exists() && tsAudio.exists()) { - QStringList apps = mimeUtilsPtr->getDefault("x-content/audio-dvd"); - qDebug() << "audio dvd apps" << apps; - desktop = Common::findApplication(qApp->applicationFilePath(), - apps.at(0)); - } - if (desktop.isEmpty()) { return; } - DesktopFile df(desktop); - QString app = df.getExec().split(" ").takeFirst(); - if (app.isEmpty()) { return; } - if (app.endsWith("mplayer")) { - // workaround for mplayer - QProcess::startDetached(QString("%1 dvd:// -dvd-device /dev/%2") - .arg(app) + //showMessage(QObject::tr("APP"), QObject::tr("In auto play DVD")); + // ensure we're dealing with a DVD movie (UDF) + QString dvdDev = path.split("/").takeLast(); + QString exe = "file -s /dev/" + dvdDev; + //std::cout << wholeDevPath.toStdString() << std::endl; + QProcess findDriveFilesystem; + findDriveFilesystem.start(exe); + findDriveFilesystem.waitForFinished(); + QString output(findDriveFilesystem.readAllStandardOutput()); + if (!output.contains("UDF filesystem data", Qt::CaseInsensitive)){ return; } + // + //QString desktop; + //QStringList apps = mimeUtilsPtr->getDefault("x-content/video-dvd"); + //desktop = Common::findApplication(qApp->applicationFilePath(), apps.at(0)); + //std::cout << desktop.toStdString() << std::endl; + + // This is how mpv AND mplayer like to do it... Absolute uses mpv + QProcess::startDetached(QString("mpv dvd:// -dvd-device /dev/%2") .arg(path.split("/").takeLast())); - } else { - QProcess::startDetached(QString("%1 dvd://%2") - .arg(app).arg(man->devices[path]->mountpoint)); - } - } - if (openMedia) { - openMountpoint(man->devices[path]->mountpoint); + generateContextMenu(); } - generateContextMenu(); } } @@ -320,7 +300,6 @@ { qDebug() << "open mountpoint" << mountpoint; if (mountpoint.isEmpty()) { return; } - QDBusInterface fmSession(FM_SERVICE, FM_PATH, FM_SERVICE, @@ -328,6 +307,7 @@ if (fmSession.isValid()) { fmSession.call("openPath", mountpoint); } else { + std::cout << "In openMountPoint - 4444" << std::endl; QProcess::startDetached(QString("qtfm \"%1\"").arg(mountpoint)); } }