Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
Kamera
Commits
3e4cf277
Commit
3e4cf277
authored
Aug 30, 2021
by
Laurent Montel
😁
Browse files
Fix use ecm 5.85
parent
52b1abf3
Changes
4
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
3e4cf277
...
...
@@ -8,7 +8,8 @@ set (RELEASE_SERVICE_VERSION_MICRO "70")
set
(
RELEASE_SERVICE_VERSION
"
${
RELEASE_SERVICE_VERSION_MAJOR
}
.
${
RELEASE_SERVICE_VERSION_MINOR
}
.
${
RELEASE_SERVICE_VERSION_MICRO
}
"
)
set
(
PROJECT_VERSION
${
RELEASE_SERVICE_VERSION
}
)
find_package
(
ECM REQUIRED NO_MODULE
)
set
(
KF5_MIN_VERSION
"5.85.0"
)
find_package
(
ECM
${
KF5_MIN_VERSION
}
REQUIRED NO_MODULE
)
set
(
CMAKE_MODULE_PATH
${
ECM_MODULE_PATH
}
${
CMAKE_SOURCE_DIR
}
)
include
(
KDEInstallDirs
)
include
(
KDECMakeSettings
)
...
...
@@ -16,7 +17,6 @@ include(KDECompilerSettings)
include
(
FindPkgConfig
)
include
(
FeatureSummary
)
set
(
KF5_MIN_VERSION
"5.85.0"
)
find_package
(
Qt5 5.15 REQUIRED COMPONENTS Core
)
find_package
(
KF5
${
KF5_MIN_VERSION
}
REQUIRED COMPONENTS
...
...
@@ -50,7 +50,8 @@ include(ConfigureChecks.cmake)
configure_file
(
config-kamera.h.cmake
${
CMAKE_CURRENT_BINARY_DIR
}
/config-kamera.h
)
set
(
CMAKE_CXX_FLAGS_DEBUG,
"
${
CMAKE_CXX_FLAGS_DEBUG
}
-Wall -Wunused -Wextra -DDEBUG_KAMERA_KIO -DDEBUG_KAMERA_KCONTROL"
)
remove_definitions
(
-DQT_NO_CAST_FROM_ASCII
)
remove_definitions
(
-DQT_NO_CAST_FROM_BYTEARRAY
)
add_subdirectory
(
kcontrol
)
add_subdirectory
(
kioslave
)
add_subdirectory
(
doc
)
...
...
kcontrol/kamera.cpp
View file @
3e4cf277
...
...
@@ -219,11 +219,11 @@ void KKameraConfig::load(void)
qCDebug
(
KAMERA_KCONTROL
)
<<
"Loading configuration for serial port camera: "
<<
*
it
;
kcamera
=
new
KCamera
(
*
it
,
cg
.
readEntry
(
"Path"
));
connect
(
kcamera
,
Q
Overload
<
const
QString
&>
::
of
(
&
KCamera
::
error
),
this
,
Q
Overload
<
const
QString
&>
::
of
(
&
KKameraConfig
::
slot_error
));
connect
(
kcamera
,
q
Overload
<
const
QString
&>
(
&
KCamera
::
error
),
this
,
q
Overload
<
const
QString
&>
(
&
KKameraConfig
::
slot_error
));
connect
(
kcamera
,
Q
Overload
<
const
QString
&
,
const
QString
&>
::
of
(
&
KCamera
::
error
),
this
,
Q
Overload
<
const
QString
&
,
const
QString
&>
::
of
(
&
KKameraConfig
::
slot_error
));
connect
(
kcamera
,
q
Overload
<
const
QString
&
,
const
QString
&>
(
&
KCamera
::
error
),
this
,
q
Overload
<
const
QString
&
,
const
QString
&>
(
&
KKameraConfig
::
slot_error
));
kcamera
->
load
(
m_config
);
m_devices
[
*
it
]
=
kcamera
;
...
...
@@ -266,11 +266,11 @@ void KKameraConfig::load(void)
kcamera
=
new
KCamera
(
portit
.
value
(),
portit
.
key
());
connect
(
kcamera
,
Q
Overload
<
const
QString
&>
::
of
(
&
KCamera
::
error
),
this
,
Q
Overload
<
const
QString
&>
::
of
(
&
KKameraConfig
::
slot_error
));
connect
(
kcamera
,
q
Overload
<
const
QString
&>
(
&
KCamera
::
error
),
this
,
q
Overload
<
const
QString
&>
(
&
KKameraConfig
::
slot_error
));
connect
(
kcamera
,
Q
Overload
<
const
QString
&
,
const
QString
&>
::
of
(
&
KCamera
::
error
),
this
,
Q
Overload
<
const
QString
&
,
const
QString
&>
::
of
(
&
KKameraConfig
::
slot_error
));
connect
(
kcamera
,
q
Overload
<
const
QString
&
,
const
QString
&>
(
&
KCamera
::
error
),
this
,
q
Overload
<
const
QString
&
,
const
QString
&>
(
&
KKameraConfig
::
slot_error
));
m_devices
[
portit
.
value
()]
=
kcamera
;
}
...
...
@@ -326,11 +326,11 @@ QString KKameraConfig::suggestName(const QString &name)
void
KKameraConfig
::
slot_addCamera
()
{
KCamera
*
m_device
=
new
KCamera
(
QString
(),
QString
());
connect
(
m_device
,
Q
Overload
<
const
QString
&>
::
of
(
&
KCamera
::
error
),
this
,
Q
Overload
<
const
QString
&>
::
of
(
&
KKameraConfig
::
slot_error
));
connect
(
m_device
,
q
Overload
<
const
QString
&>
(
&
KCamera
::
error
),
this
,
q
Overload
<
const
QString
&>
(
&
KKameraConfig
::
slot_error
));
connect
(
m_device
,
Q
Overload
<
const
QString
&
,
const
QString
&>
::
of
(
&
KCamera
::
error
),
this
,
Q
Overload
<
const
QString
&
,
const
QString
&>
::
of
(
&
KKameraConfig
::
slot_error
));
connect
(
m_device
,
q
Overload
<
const
QString
&
,
const
QString
&>
(
&
KCamera
::
error
),
this
,
q
Overload
<
const
QString
&
,
const
QString
&>
(
&
KKameraConfig
::
slot_error
));
KameraDeviceSelectDialog
dialog
(
this
,
m_device
);
if
(
dialog
.
exec
()
==
QDialog
::
Accepted
)
{
...
...
@@ -338,7 +338,7 @@ void KKameraConfig::slot_addCamera()
m_device
->
setName
(
suggestName
(
m_device
->
model
()));
m_devices
.
insert
(
m_device
->
name
(),
m_device
);
populateDeviceListView
();
emit
changed
(
true
);
Q_EMIT
changed
(
true
);
}
else
{
delete
m_device
;
}
...
...
@@ -353,7 +353,7 @@ void KKameraConfig::slot_removeCamera()
delete
m_device
;
m_config
->
deleteGroup
(
name
);
populateDeviceListView
();
emit
changed
(
true
);
Q_EMIT
changed
(
true
);
}
}
...
...
kcontrol/kameradevice.cpp
View file @
3e4cf277
...
...
@@ -90,17 +90,17 @@ bool KCamera::initInformation()
}
if
(
gp_abilities_list_new
(
&
m_abilitylist
)
!=
GP_OK
)
{
emit
error
(
i18n
(
"Could not allocate memory for the abilities list."
));
Q_EMIT
error
(
i18n
(
"Could not allocate memory for the abilities list."
));
return
false
;
}
if
(
gp_abilities_list_load
(
m_abilitylist
,
glob_context
)
!=
GP_OK
)
{
emit
error
(
i18n
(
"Could not load ability list."
));
Q_EMIT
error
(
i18n
(
"Could not load ability list."
));
return
false
;
}
int
index
=
gp_abilities_list_lookup_model
(
m_abilitylist
,
m_model
.
toLocal8Bit
().
data
());
if
(
index
<
0
)
{
emit
error
(
i18n
(
"Description of abilities for camera %1 is not available."
Q_EMIT
error
(
i18n
(
"Description of abilities for camera %1 is not available."
" Configuration options may be incorrect."
,
m_model
));
return
false
;
}
...
...
@@ -124,7 +124,7 @@ bool KCamera::initCamera()
result
=
gp_camera_new
(
&
m_camera
);
if
(
result
!=
GP_OK
)
{
// m_camera is not initialized, so we cannot get result as string
emit
error
(
i18n
(
"Could not access driver. Check your gPhoto2 installation."
));
Q_EMIT
error
(
i18n
(
"Could not access driver. Check your gPhoto2 installation."
));
return
false
;
}
...
...
@@ -143,7 +143,7 @@ bool KCamera::initCamera()
if
(
result
!=
GP_OK
)
{
gp_camera_free
(
m_camera
);
m_camera
=
NULL
;
emit
error
(
Q_EMIT
error
(
i18n
(
"Unable to initialize camera. Check your port settings and camera connectivity and try again."
),
QString
::
fromLocal8Bit
(
gp_result_as_string
(
result
)));
return
false
;
...
...
@@ -182,7 +182,7 @@ bool KCamera::configure()
result
=
gp_camera_get_config
(
m_camera
,
&
window
,
glob_context
);
if
(
result
!=
GP_OK
)
{
emit
error
(
i18n
(
"Camera configuration failed."
),
Q_EMIT
error
(
i18n
(
"Camera configuration failed."
),
QString
::
fromLocal8Bit
(
gp_result_as_string
(
result
)));
return
false
;
}
...
...
@@ -193,7 +193,7 @@ bool KCamera::configure()
if
(
result
==
GP_PROMPT_OK
)
{
result
=
gp_camera_set_config
(
m_camera
,
window
,
glob_context
);
if
(
result
!=
GP_OK
)
{
emit
error
(
i18n
(
"Camera configuration failed."
),
Q_EMIT
error
(
i18n
(
"Camera configuration failed."
),
QString
::
fromLocal8Bit
(
gp_result_as_string
(
result
)));
return
false
;
}
...
...
@@ -300,11 +300,11 @@ KameraDeviceSelectDialog::KameraDeviceSelectDialog(QWidget *parent, KCamera *dev
setModal
(
true
);
m_device
=
device
;
connect
(
m_device
,
Q
Overload
<
const
QString
&>
::
of
(
&
KCamera
::
error
),
this
,
Q
Overload
<
const
QString
&>
::
of
(
&
KameraDeviceSelectDialog
::
slot_error
));
connect
(
m_device
,
q
Overload
<
const
QString
&>
(
&
KCamera
::
error
),
this
,
q
Overload
<
const
QString
&>
(
&
KameraDeviceSelectDialog
::
slot_error
));
connect
(
m_device
,
Q
Overload
<
const
QString
&
,
const
QString
&>
::
of
(
&
KCamera
::
error
),
this
,
Q
Overload
<
const
QString
&
,
const
QString
&>
::
of
(
&
KameraDeviceSelectDialog
::
slot_error
));
connect
(
m_device
,
q
Overload
<
const
QString
&
,
const
QString
&>
(
&
KCamera
::
error
),
this
,
q
Overload
<
const
QString
&
,
const
QString
&>
(
&
KameraDeviceSelectDialog
::
slot_error
));
QWidget
*
page
=
new
QWidget
(
this
);
...
...
@@ -499,8 +499,8 @@ void KameraDeviceSelectDialog::load()
setPortType
(
INDEX_USB
);
}
QList
<
QStandardItem
*>
items
=
m_model
->
findItems
(
m_device
->
model
());
for
each
(
QStandardItem
*
item
,
items
)
{
const
QList
<
QStandardItem
*>
items
=
m_model
->
findItems
(
m_device
->
model
());
for
(
QStandardItem
*
item
:
items
)
{
const
QModelIndex
index
=
m_model
->
indexFromItem
(
item
);
m_modelSel
->
selectionModel
()
->
select
(
index
,
QItemSelectionModel
::
Select
);
}
...
...
kioslave/kamera.cpp
View file @
3e4cf277
...
...
@@ -282,14 +282,14 @@ void KameraProtocol::get(const QUrl &url)
GPHOTO_TEXT_FILE
(
summary
);
#undef GPHOTO_TEXT_FILE
//
emit
info message
//
Q_EMIT
info message
// WARNING Fix this
//infoMessage( i18n("Retrieving data from camera <b>%1</b>", current_camera) );
// Note: There's no need to re-read directory for each get() anymore
gp_file_new
(
&
m_file
);
//
emit
the total size (we must do it before sending data to allow preview)
//
Q_EMIT
the total size (we must do it before sending data to allow preview)
CameraFileInfo
info
;
gpr
=
gp_camera_file_get_info
(
m_camera
,
...
...
@@ -367,7 +367,7 @@ void KameraProtocol::get(const QUrl &url)
QString
::
fromLocal8Bit
(
gp_result_as_string
(
gpr
)));
return
;
}
//
emit
the mimetype
//
Q_EMIT
the mimetype
// NOTE: we must first get the file, so that CameraFile->name would be set
const
char
*
fileMimeType
;
gp_file_get_mime_type
(
m_file
,
&
fileMimeType
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment