mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
[gtk widget] Use text/uri-list for file drag&drop.
This commit is contained in:
parent
525b4e1888
commit
4381425b26
1 changed files with 8 additions and 13 deletions
|
|
@ -793,12 +793,8 @@ nsDragService::GetData(nsITransferable * aTransferable,
|
|||
// Dragging and dropping from the file manager would cause us
|
||||
// to parse the source text as a nsIFile URL.
|
||||
if ( strcmp(flavorStr, kFileMime) == 0 ) {
|
||||
gdkFlavor = gdk_atom_intern(kTextMime, FALSE);
|
||||
gdkFlavor = gdk_atom_intern(gTextUriListType, FALSE);
|
||||
GetTargetDragData(gdkFlavor);
|
||||
if (!mTargetDragData) {
|
||||
gdkFlavor = gdk_atom_intern(gTextUriListType, FALSE);
|
||||
GetTargetDragData(gdkFlavor);
|
||||
}
|
||||
if (mTargetDragData) {
|
||||
const char* text = static_cast<char*>(mTargetDragData);
|
||||
char16_t* convertedText = nullptr;
|
||||
|
|
@ -1077,8 +1073,8 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor,
|
|||
(strcmp(aDataFlavor, kURLMime) == 0 ||
|
||||
strcmp(aDataFlavor, kFileMime) == 0)) {
|
||||
MOZ_LOG(sDragLm, LogLevel::Debug,
|
||||
("good! ( it's text/uri-list and \
|
||||
we're checking against text/x-moz-url )\n"));
|
||||
("good! (it's text/uri-list and \
|
||||
we're checking against text/x-moz-url)\n"));
|
||||
*_retval = true;
|
||||
}
|
||||
// check for automatic _NETSCAPE_URL -> text/x-moz-url mapping
|
||||
|
|
@ -1087,19 +1083,18 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor,
|
|||
(strcmp(name, gMozUrlType) == 0) &&
|
||||
(strcmp(aDataFlavor, kURLMime) == 0)) {
|
||||
MOZ_LOG(sDragLm, LogLevel::Debug,
|
||||
("good! ( it's _NETSCAPE_URL and \
|
||||
we're checking against text/x-moz-url )\n"));
|
||||
("good! (it's _NETSCAPE_URL and \
|
||||
we're checking against text/x-moz-url)\n"));
|
||||
*_retval = true;
|
||||
}
|
||||
// check for auto text/plain -> text/unicode mapping
|
||||
if (!*_retval &&
|
||||
name &&
|
||||
(strcmp(name, kTextMime) == 0) &&
|
||||
((strcmp(aDataFlavor, kUnicodeMime) == 0) ||
|
||||
(strcmp(aDataFlavor, kFileMime) == 0))) {
|
||||
(strcmp(aDataFlavor, kUnicodeMime) == 0)) {
|
||||
MOZ_LOG(sDragLm, LogLevel::Debug,
|
||||
("good! ( it's text plain and we're checking \
|
||||
against text/unicode or application/x-moz-file)\n"));
|
||||
("good! (it's text plain and we're checking \
|
||||
against text/unicode)\n"));
|
||||
*_retval = true;
|
||||
}
|
||||
g_free(name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue