MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / dropEvent

Method dropEvent

launcher/ui/dialogs/BlockedModsDialog.cpp:97–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97void BlockedModsDialog::dropEvent(QDropEvent* e)
98{
99 for (QUrl& url : e->mimeData()->urls()) {
100 if (url.scheme().isEmpty()) { // ensure isLocalFile() works correctly
101 url.setScheme("file");
102 }
103
104 if (!url.isLocalFile()) { // can't drop external files here.
105 continue;
106 }
107
108 QString filePath = url.toLocalFile();
109 qDebug() << "[Blocked Mods Dialog] Dropped file:" << filePath;
110 addHashTask(filePath);
111
112 // watch for changes
113 QFileInfo file = QFileInfo(filePath);
114 QString path = file.dir().absolutePath();
115 qDebug() << "[Blocked Mods Dialog] Adding watch path:" << path;
116 m_watcher.addPath(path);
117 }
118 scanPaths();
119 update();
120}
121
122void BlockedModsDialog::done(int r)
123{

Callers

nothing calls this directly

Calls 5

QFileInfoClass · 0.85
dirMethod · 0.80
addPathMethod · 0.80
mimeDataMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected