Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F618923
DirectoryLineEdit.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
887 B
Referenced Files
None
Subscribers
None
DirectoryLineEdit.cpp
View Options
#include
"DirectoryLineEdit.h"
#include
<QDebug>
#include
<QDragEnterEvent>
#include
<QFileInfo>
#include
<QMimeData>
#include
"common/misc.h"
DirectoryLineEdit
::
DirectoryLineEdit
(
QWidget
*
parent
)
:
QLineEdit
(
parent
)
{
}
void
DirectoryLineEdit
::
dragEnterEvent
(
QDragEnterEvent
*
event
)
{
if
(
event
->
mimeData
()
->
hasUrls
())
{
event
->
acceptProposedAction
();
event
->
accept
();
return
;
}
QLineEdit
::
dragEnterEvent
(
event
);
}
void
DirectoryLineEdit
::
dropEvent
(
QDropEvent
*
event
)
{
QList
<
QUrl
>
urls
=
event
->
mimeData
()
->
urls
();
if
(
urls
.
size
()
==
1
)
{
QString
path
=
urls
[
0
].
url
();
if
(
path
.
startsWith
(
"file://"
))
{
int
i
=
7
;
#ifdef Q_OS_WIN
if
(
path
.
utf16
()[
i
]
==
'/'
)
{
i
++
;
}
#endif
path
=
path
.
mid
(
i
);
if
(
QFileInfo
(
path
).
isDir
())
{
path
=
misc
::
normalizePathSeparator
(
path
);
setText
(
path
);
}
}
return
;
}
QLineEdit
::
dropEvent
(
event
);
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sat, Nov 14, 3:56 PM (6 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
132334
Default Alt Text
DirectoryLineEdit.cpp (887 B)
Attached To
Mode
R77 Guitar
Attached
Detach File
Event Timeline