Repository navigation
QTestDisk: Qt front-end for TestDisk using /cmd mode - #219
Open
maysaraadmin wants to merge 4 commits into
Open
maysaraadmin wants to merge 4 commits into
maysaraadmin wants to merge 4 commits into
Conversation
qtestdisk drives the existing "testdisk /cmd" scripting mode and shows the partitions found from the "Results" section of the log, so the recovery logic stays in testdisk. It offers disk/image selection, partition table type, Quick Search, Deeper Search, Stop and a confirmed "Write partition table". Built alongside qphotorec when Qt5/Qt6 is detected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- man page, .desktop file, Windows icon/version/manifest (highestAvailable), install/uninstall/static/spec/.gitignore entries - Stop is disabled during a write, and closing the window lets a running write complete instead of killing testdisk - usual file header, version in window title, "Stopped" status after Stop Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… result A search finding nothing used to enable "Write partition table", and testdisk then rejected "noconfirm,write" with a syntax error while the status said "Done". Write is now enabled only when "Results" lists at least one partition, and the status says whether testdisk logged "write!". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by cross-compiling with mingw64 (pdcurses, Qt5) and running on Windows 11: - pdcurses exits with "Redirection is not supported." when stdout is a pipe: "testdisk /cmd" now gets its own hidden console, results are still read from the log - pdcurses rejects LINES > 45: LINES/COLUMNS/TERM are only set for ncurses (non-Windows) - testdisk.log has CRLF line endings on Windows: read it in text mode - "testdisk /list" names volumes "Drive X:" (device \.\X:) and lists each disk twice: parse both forms and skip duplicates - UI no longer stays busy when the testdisk program is not found Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
maysaraadmin
marked this pull request as ready for review
November 11, 2026 13:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds QTestDisk (
qtestdisk), a small Qt GUI for TestDisk, built and installed next toqphotorecwhen Qt5 or Qt6 is found.Design: no change to TestDisk itself
QPhotoRec links the PhotoRec engine. TestDisk's ncurses UI is mixed into the analyse, search and write code, so linking it would need a large refactor. Instead, qtestdisk drives the existing
/cmdmode and reads the log:It displays the
Resultssection thatinterface_recovery()logs. No existing C file is modified. The new code is one C++ file, about 320 lines, with no moc, rcc or extra dependency.Safety
,noconfirm,write.write!.TERMset if missing, andLINES/COLUMNSset, so no ncurses prompt can block it.Windows
PDCurses exits with
Redirection is not supported.when stdout is a pipe. On Windows, qtestdisk therefore startstestdisk /cmdwith its own hidden console (setCreateProcessArgumentsModifier), so no console window appears. It also:LINES/COLUMNS, which PDCurses rejects above 45Drive X:lines (device\\.\X:) printed bytestdisk /listThe
.exegets the TestDisk icon and ahighestAvailablemanifest, likeqphotorec_win.exe.Files
src/qtestdisk.cpp: the app, with an assert-based check of the log parsing at startup.configure.ac,src/Makefile.am:qtestdisk_LDADDandqtestdisk_CXXFLAGSfor Qt6 or Qt5 (-mwindowson Windows), plusman/qtestdisk.8.man/qtestdisk.8.in,linux/qtestdisk.desktopsrc/icon_qtd.rcandwin/qtestdisk_win.exe.manifest(TestDisk icon,highestAvailable)staticandEXTRA_DISTentries inMakefile.amandman/Makefile.amtestdisk-copr.spec,mingw-testdisk-copr.spec,.gitignoreLimitations
/cmdwrites what the search found. The dialog and man page point to text-mode testdisk for that.tr().Testing
Ubuntu 24.04 containers, GUI under Xvfb driven with xdotool:
qtestdisk.cppis clean with-Wall -Wextra.make install,make dist, anddesktop-file-validate linux/qtestdisk.desktop. The man page renders.LOSTPARTwith its MBR entry deleted: Quick Search finds it. After Write,sfdisk -lshows2048 102399 100352 b W95 FAT32.LOSTPARTwith its entry deleted: Deeper Search finds it, and Write restores it.mingw64-gcc,mingw64-pdcursesandmingw64-qt5-qtbase(the packages frommingw-testdisk-copr.spec). Run natively on Windows 11 and driven with UI Automation:/listshows the drive.FAT32 ... [LOSTPART].sfdisk -lconfirms2048 102399 100352 b W95 FAT32.🤖 Generated with Claude Code