Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F633139
imageuploader.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
1 KB
Referenced Files
None
Subscribers
None
imageuploader.cpp
View Options
#include
"imageuploader.h"
#include
"imguruploader.h"
#include
"pomfuploader.h"
#include
<QSettings>
#include
"../screenshotmanager.h"
ImageUploader
*
ImageUploader::factory
(
const
QString
&
name
)
{
if
(
name
==
"imgur"
)
{
return
new
ImgurUploader
;
}
else
if
(
name
==
"pomf"
)
{
return
new
PomfUploader
;
}
return
nullptr
;
}
QVariantHash
ImageUploader::loadSettings
(
const
QString
&
uploaderType
)
{
auto
globalSettings
=
ScreenshotManager
::
instance
()
->
settings
();
globalSettings
->
beginGroup
(
"upload/"
+
uploaderType
);
auto
keys
=
globalSettings
->
childKeys
();
QVariantHash
settings
;
for
(
auto
key
:
qAsConst
(
keys
))
{
settings
[
key
]
=
globalSettings
->
value
(
key
);
}
globalSettings
->
endGroup
();
return
settings
;
}
void
ImageUploader::loadSettings
()
{
mSettings
=
loadSettings
(
mUploaderType
);
}
void
ImageUploader::saveSettings
(
const
QString
&
uploaderType
,
const
QVariantHash
&
settings
)
{
auto
globalSettings
=
ScreenshotManager
::
instance
()
->
settings
();
globalSettings
->
beginGroup
(
"upload/"
+
uploaderType
);
for
(
auto
key
:
settings
.
keys
())
{
globalSettings
->
setValue
(
key
,
settings
[
key
]);
}
globalSettings
->
endGroup
();
}
void
ImageUploader::saveSettings
()
{
saveSettings
(
mUploaderType
,
mSettings
);
}
int
ImageUploader::progress
()
const
{
return
mProgress
;
}
void
ImageUploader::setProgress
(
int
progress
)
{
if
(
mProgress
!=
progress
)
{
mProgress
=
progress
;
emit
progressChanged
(
mProgress
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sun, Nov 15, 4:09 PM (7 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
120064
Default Alt Text
imageuploader.cpp (1 KB)
Attached To
Mode
R63 darkscreen
Attached
Detach File
Event Timeline