mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 12:32:43 +00:00
Qt: Allow to drop RAP&PKG together
This commit is contained in:
parent
46350200d7
commit
2da78c6591
@ -3255,21 +3255,21 @@ main_window::drop_type main_window::IsValidFile(const QMimeData& md, QStringList
|
||||
}
|
||||
else if (info.suffix().toLower() == "pkg")
|
||||
{
|
||||
if (drop_type != drop_type::drop_pkg && drop_type != drop_type::drop_error)
|
||||
if (drop_type != drop_type::drop_rap_edat_pkg && drop_type != drop_type::drop_error)
|
||||
{
|
||||
return drop_type::drop_error;
|
||||
}
|
||||
|
||||
drop_type = drop_type::drop_pkg;
|
||||
drop_type = drop_type::drop_rap_edat_pkg;
|
||||
}
|
||||
else if (info.suffix().toLower() == "rap" || info.suffix().toLower() == "edat")
|
||||
{
|
||||
if (info.size() < 0x10 || (drop_type != drop_type::drop_rap_edat && drop_type != drop_type::drop_error))
|
||||
if (info.size() < 0x10 || (drop_type != drop_type::drop_rap_edat_pkg && drop_type != drop_type::drop_error))
|
||||
{
|
||||
return drop_type::drop_error;
|
||||
}
|
||||
|
||||
drop_type = drop_type::drop_rap_edat;
|
||||
drop_type = drop_type::drop_rap_edat_pkg;
|
||||
}
|
||||
else if (list.size() == 1)
|
||||
{
|
||||
@ -3309,7 +3309,7 @@ void main_window::dropEvent(QDropEvent* event)
|
||||
event->ignore();
|
||||
break;
|
||||
}
|
||||
case drop_type::drop_pkg: // install the packages
|
||||
case drop_type::drop_rap_edat_pkg: // install the packages
|
||||
{
|
||||
InstallPackages(drop_paths);
|
||||
break;
|
||||
@ -3319,35 +3319,6 @@ void main_window::dropEvent(QDropEvent* event)
|
||||
InstallPup(drop_paths.first());
|
||||
break;
|
||||
}
|
||||
case drop_type::drop_rap_edat: // import rap files to exdata dir
|
||||
{
|
||||
int installed_count = 0;
|
||||
|
||||
for (const auto& path : drop_paths)
|
||||
{
|
||||
const QFileInfo file_info = path;
|
||||
const std::string extension = file_info.suffix().toLower().toStdString();
|
||||
const std::string filename = sstr(file_info.fileName());
|
||||
|
||||
if (InstallFileInExData(extension, path, filename))
|
||||
{
|
||||
gui_log.success("Successfully copied %s file by drop: %s", extension, filename);
|
||||
installed_count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_log.error("Could not copy %s file by drop: %s", extension, filename);
|
||||
}
|
||||
}
|
||||
|
||||
if (installed_count > 0)
|
||||
{
|
||||
// Refresh game list since we probably unlocked some games now.
|
||||
m_game_list_frame->Refresh(true);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case drop_type::drop_psf: // Display PARAM.SFO content
|
||||
{
|
||||
for (const auto& psf : drop_paths)
|
||||
|
@ -71,9 +71,8 @@ class main_window : public QMainWindow
|
||||
enum class drop_type
|
||||
{
|
||||
drop_error,
|
||||
drop_pkg,
|
||||
drop_rap_edat_pkg,
|
||||
drop_pup,
|
||||
drop_rap_edat,
|
||||
drop_psf,
|
||||
drop_dir,
|
||||
drop_game,
|
||||
|
Loading…
x
Reference in New Issue
Block a user