summaryrefslogtreecommitdiff
path: root/src/modlistviewactions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Migrating to OAuth Authentication (#2374)Jeremy Rimpo2026-05-121-6/+8
| | | | Co-authored-by: aglowinthefield <146008217+aglowinthefield@users.noreply.github.com> Co-authored-by: Jonathan Feenstra <26406078+JonathanFeenstra@users.noreply.github.com>
* Stable DownloadId refactor (#2375)Al2026-05-071-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Encapsulate the downloads directory watcher in DirWatcherManager QFileSystemWatcher suppression currently relies on public static start/end methods and a static counter. Seven call sites pair them raw, one of them outside the class. Any exception between a pair permanently disables the watcher, and the static counter implies a singleton DownloadManager. A new DirWatcherManager owns the watcher, the counter (now an instance member), and the filtering. The only way to suspend is an RAII Guard obtained via a scopedGuard() factory. All raw pairs migrate to guards. A TODO flags the existing processEvents() in the dtor as a known reentrancy hazard worth replacing later. * Replace aboutToUpdate/update(int) with ModelResetGuard Replace the fragile two-signal protocol with a refcounted RAII ModelResetGuard. Split update(int) into aboutToResetModel/modelReset (guard only) and rowChanged(int); notifyRowChanged() is suppressed while a reset is active. Fixes "beginResetModel without endResetModel" warnings from three sites in downloadFinished/removeDownload that were pairing reset with a row update. removePending only opens a guard when an actual match is removed. * Centralize row notifications in setState and fix missed emits setState emits notifyRowChanged itself, uses indexByInfo (-1 when untracked), and re-looks up the row at each use so reply->abort() and plugin callbacks that re-enter and erase info don't produce stale signals. Remove the trailing emit loop from createMetaFile and the now-redundant notifyRowChanged calls scattered after setState. Add the two missing emits in restoreDownload (after m_Hidden) and metaDataChanged (after rename). Guard downloadFinished with a top-level DirWatcherGuard to prevent filesystem events from its writes racing with model updates. * Fix comma operator in addNXMDownload pending-dedup check The game-name comparison result was discarded by the comma operator, so the dedup only matched modId/fileId across all games. * Fix lost finished() signal on fast downloads Hoist the file-exists prompt out of startDownload so setup is straight-line. Connect finished() last and dispatch manually if the reply already finished. * Fix memory leak in DownloadInfo::createFromMeta Move the allocation past the early-return checks so path-mismatch and hidden-skip paths no longer leak a fresh DownloadInfo. * Sanitize suffix path in getDownloadFileName The collision-avoidance branch was using the raw baseName, so invalid characters sanitized out of the initial path leaked into the suffixed one. * [pre-commit.ci] Auto fixes from pre-commit.com hooks. * Remove unused alphabetical translation vector m_AlphabeticalTranslation was written but never read; drop it along with refreshAlphabeticalTranslation, ByName, and the LessThanWrapper helper. * Address PR feedback: fix redundant check and move refresh outside try catch. * Coalesce the removeDownload reset with the following refreshList Moves the ModelResetGuard out of the try-catch so it also wraps the refreshList() call below. Without this, one reset fires when the guard destructs at the end of the try block and another fires from refreshList's own guard, producing two resets where one is sufficient. * Guard the .meta creation in openMetaFile against the directory watcher openMetaFile creates the .meta file via QSettings when one does not exist; the disk write fires directoryChanged and triggers a spurious refreshList. Wrap it in a DirWatcherManager::Guard like the other meta-file editing paths. * Extract getValidGameShortName method in download manager (#2380) * Add stable download id index and PendingDownload struct Replace the (game, mod, file) tuple backing m_PendingDownloads with a named struct, and add m_ByID as an O(1) m_DownloadID-to-info index kept in sync with every m_ActiveDownloads mutation. Encapsulate the id counter behind DownloadInfo::newDownloadID(), the only supported way to consume from s_NextDownloadID. Infrastructure only; external behaviour is unchanged. * Return stable ids from the plugin-facing download API startDownloadURLs / startDownloadNexusFile / addNXMDownload now reserve and return m_DownloadID instead of a stale index. Plugin callbacks fire with m_DownloadID; downloadPath looks up via m_ByID. nxmDownloadURLsAvailable threads the reserved id into the materializing DownloadInfo, and Nexus API failures wake waiting plugins via notifyPendingDownloadFailed. Incidental: startDownload now returns bool and frees newDownload on output-open failure; createMetaFile is deferred past that check so failed starts no longer leave an orphan .meta. * Split downloadFinished into onReplyFinished slot and finishDownload The old dual-use downloadFinished(int = 0) took either an explicit index or relied on sender() when called as a slot. Split into a sender-resolved slot and an id-based direct call, removing the ambiguous index-zero path. * Introduce DownloadID alias and row/id accessors Add a DownloadID type alias for the stable per-download handle and two public accessors (downloadIDAtRow, rowForDownloadID) so callers can translate between the view's row vocabulary and the model's id vocabulary without reaching into the manager's internals. DownloadList now embeds the DownloadID in QModelIndex::internalId() so any code holding an index can identify the download directly. * Convert cancel/pause/resume action methods to take DownloadID The four methods (cancel, pause, resume, resumeDownloadInt) now accept a DownloadID, resolve through m_ByID, and no longer care about row positions. Internal callers iterate DownloadInfo* or look up via id; DownloadsTab translates row -> id at the connect boundary so the view's int-shaped signals keep working unchanged. Also switches the remaining unsigned int signatures that refer to the download id (finishDownload, downloadInfoByID, PendingDownload::reservedID, m_ByID, newDownloadID, s_NextDownloadID) to the DownloadID alias. Drive-by fix: finishDownload's retry branch could read info->m_Tries after info had been deleted in the CANCELED/retries-exhausted branch above; now re-resolves via m_ByID.value(id) before touching any fields. * [pre-commit.ci] Auto fixes from pre-commit.com hooks. * fix warnings about unused variables and size_t types * cleanup dead code * avoid calling processEvents when releasing the DirWatcherGuard * [pre-commit.ci] Auto fixes from pre-commit.com hooks. * use QEventLoop instead of manual ProcessEvents * don't call processEvents in download started and defer handling finish state in event loop * Cleanup pending download in case of failure. * Add missing notifyPendingDownloadFailed if user cancels * [pre-commit.ci] Auto fixes from pre-commit.com hooks. * Refactor pending download failure handling and cover rename failures * fix rebase bug, addNXMDownload not returning the correct type --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jonathan Feenstra <26406078+JonathanFeenstra@users.noreply.github.com>
* Add author and uploader columns to mod list (#2269)Jonathan Feenstra2025-08-181-15/+55
|
* Oblivion Remastered Meta PR (#2241)Jeremy Rimpo2025-05-231-9/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Allow for mod directory maps - Set main data files based on game - Mapped mod directories to VFS - Update overwrite setup * Skip if mod contains no 'data' dir * More mod directory compatibility fixes * Workaround for Obl:Rem save location - SLocalSavePath does nothing yet MO2 wants to use it to override the default save location - This only applies to BGS games anyway, we should move this logic * First pass for overwrite mod directory support * More overwrite move / delete restrictions * Fix issue with moving directories that are not required * Formatting pass * More modDataDirectory updates * Formatting --------- Co-authored-by: Mikaël Capelle <capelle.mikael@gmail.com>
* A few fixes for RC 1Jeremy Rimpo2023-11-161-1/+5
| | | | | | | * Convert the priority index to a string as Windows appears to be converting these to localized numerals * Skip separators when assigning categories * Update the context menu requirements for displaying the auto-assign option * Bump to RC 2
* Make category struct attributes privateJeremy Rimpo2023-09-231-2/+1
|
* Restructure category refresh actionJeremy Rimpo2023-09-231-4/+4
| | | | | | | - Remove plugins class - Route signals to run Nexus API call from MainWindow - Pass Dialog instance to route response data - Revert CategoryFactory::instance to return reference
* Rework download category parsingJeremy Rimpo2023-09-211-9/+10
| | | | | - Bypasses issue where hidden downloads are not accessible - getCategoryID no longer necessary
* Dialogs and bugfixesJeremy Rimpo2023-09-211-1/+16
|
* Add nexus category ID to mod infoJeremy Rimpo2023-09-211-19/+25
| | | | | - We will check the mod info first then fall back to the download file - Add category field in the info dialog nexus tab
* Clang cleanupJeremy Rimpo2023-09-211-7/+11
|
* Preserve old category if Nexus category can't be mappedJeremy Rimpo2023-09-211-6/+9
|
* Allow remapping category from context menuJeremy Rimpo2023-09-211-0/+14
|
* Add menu item to auto-assign categories based on nexus assignmentsJeremy Rimpo2023-09-211-0/+18
|
* Apply clang-format.Mikaël Capelle2023-07-091-279/+342
|
* Remove dependency on Core5CompatJeremy Rimpo2022-04-191-4/+4
|
* Fix fixDirectoryName includesChris Bessent2021-04-291-1/+1
|
* Fix priority for 'Create Empty Mod'.Mikaël Capelle2021-02-271-1/+2
|
* Fix 'Send to separator... ' in descending priority.Mikaël Capelle2021-02-241-27/+52
|
* emit modInfoDisplayed, it's required by the tutorialisanae2021-02-241-0/+1
|
* Fix enable/disable all message.Mikaël Capelle2021-01-241-1/+7
|
* Use constant for minimum/maximum priorities.Mikaël Capelle2021-01-221-3/+3
|
* Merge pull request #1372 from Holt59/install-mod-atMikaël Capelle2021-01-181-40/+47
|\ | | | | Modify 'Install mod... ' in context menu to install above current mod.
| * Make installMod behave similarly to createEmptyMod for the new mod priority.Mikaël Capelle2021-01-181-44/+41
| |
| * Modify 'Install mod... ' in context menu to install above current mod.Mikaël Capelle2021-01-181-3/+13
| |
* | Better handling of layoutChanged in by-priority proxy to avoid resetting.Mikaël Capelle2021-01-181-13/+6
|/
* Merge pull request #1363 from Holt59/modlist-improvementsAl2021-01-161-10/+61
|\ | | | | Send to last conflict
| * Maintain selection after 'Send to... ' and add send to first conflict.Mikaël Capelle2021-01-161-12/+40
| |
| * Only consider loose files vs. loose files conflicts for 'Send to last ↵Mikaël Capelle2021-01-161-2/+0
| | | | | | | | conflict' entry.
| * Add send to last conflict action for modlist.Mikaël Capelle2021-01-161-0/+25
| |
* | Contextual menu entry for enable/disable all visible.Mikaël Capelle2021-01-141-0/+12
| |
* | Better context menu entries for mod/separator creation.Mikaël Capelle2021-01-141-0/+5
|/
* Merge pull request #1360 from Holt59/organizercore-cleaningMikaël Capelle2021-01-141-2/+2
|\ | | | | OrganizerCore cleaning.
| * Remove OrganizerCore::modsSortedByProfilePriority.Mikaël Capelle2021-01-131-2/+2
| |
* | Fix drop in separator and create mod in separator in descending priority.Mikaël Capelle2021-01-111-10/+21
|/
* Select separator after creation.Mikaël Capelle2021-01-101-5/+10
|
* Change 'Create empty mod' depending on the currently selected mod.Mikaël Capelle2021-01-101-3/+28
|
* Fix create empty mod/separator position.Mikaël Capelle2021-01-021-15/+10
|
* Fix setting the primary category of multiple mods at once.Mikaël Capelle2021-01-021-1/+17
|
* Use topLevelWidget() instead of custom parent in mod list actions.Mikaël Capelle2021-01-021-3/+3
|
* Move open-explorer key combination to views.Mikaël Capelle2021-01-021-1/+3
|
* Start moving stuff from MainWindow to PluginListView.Mikaël Capelle2021-01-021-10/+13
|
* Use proper parent object in modlistviewactions.Mikaël Capelle2021-01-021-33/+34
|
* Fix parent of ModInfoDialog.Mikaël Capelle2021-01-021-1/+1
|
* Move more stuff from MainWindow. Minor improvements for prev/next button in ↵Mikaël Capelle2021-01-021-1/+6
| | | | ModInfoDialog.
* Replace hasFlag by isX.Mikaël Capelle2021-01-021-4/+3
|
* Fix originModified signal handling.Mikaël Capelle2021-01-021-1/+1
|
* Move the regular context menu.Mikaël Capelle2021-01-021-5/+227
|
* Clean visitOnX methods.Mikaël Capelle2021-01-021-47/+51
|
* Move the separator context menu.Mikaël Capelle2021-01-021-0/+98
|