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
Tobias Hunger
qt-creator
Commits
7b276878
Commit
7b276878
authored
Aug 23, 2010
by
Christian Kandeler
Browse files
Maemo: If we create a desktop file, we should also deploy it.
Reviewed-by: kh1
parent
14d7f6b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/qt-maemo/maemotemplatesmanager.cpp
View file @
7b276878
...
...
@@ -292,7 +292,7 @@ bool MaemoTemplatesManager::updateDesktopFile(const Qt4Target *target,
"Version=1.0
\n
Type=Application
\n
Terminal=false
\n
Name=
\n
Exec=
\n
"
"Icon=
\n
X-Window-Icon=
\n
X-HildonDesk-ShowInToolbar=true
\n
"
"X-Osso-Type=application/x-executable
\n
"
);
QByteArray
c
ontents
QByteArray
desktopFileC
ontents
=
existsAlready
?
desktopFile
.
readAll
()
:
desktopTemplate
;
QString
executable
;
...
...
@@ -310,18 +310,18 @@ bool MaemoTemplatesManager::updateDesktopFile(const Qt4Target *target,
qWarning
(
"Strange: Project file node not managed by MaemoDeployables."
);
}
else
{
int
execNewLinePos
,
execValuePos
;
findLine
(
"Exec="
,
c
ontents
,
execNewLinePos
,
execValuePos
);
c
ontents
.
replace
(
execValuePos
,
execNewLinePos
-
execValuePos
,
findLine
(
"Exec="
,
desktopFileC
ontents
,
execNewLinePos
,
execValuePos
);
desktopFileC
ontents
.
replace
(
execValuePos
,
execNewLinePos
-
execValuePos
,
executable
.
toUtf8
());
}
int
nameNewLinePos
,
nameValuePos
;
findLine
(
"Name="
,
c
ontents
,
nameNewLinePos
,
nameValuePos
);
findLine
(
"Name="
,
desktopFileC
ontents
,
nameNewLinePos
,
nameValuePos
);
if
(
nameNewLinePos
==
nameValuePos
)
c
ontents
.
insert
(
nameValuePos
,
appName
.
toUtf8
());
desktopFileC
ontents
.
insert
(
nameValuePos
,
appName
.
toUtf8
());
desktopFile
.
resize
(
0
);
desktopFile
.
write
(
c
ontents
);
desktopFile
.
write
(
desktopFileC
ontents
);
desktopFile
.
close
();
if
(
desktopFile
.
error
()
!=
QFile
::
NoError
)
{
qWarning
(
"Could not write '%s': %s"
,
qPrintable
(
desktopFilePath
),
...
...
@@ -331,9 +331,27 @@ bool MaemoTemplatesManager::updateDesktopFile(const Qt4Target *target,
if
(
!
existsAlready
)
{
proFileNode
->
addFiles
(
UnknownFileType
,
QStringList
()
<<
desktopFilePath
);
QFile
proFile
(
proFileNode
->
path
());
if
(
!
proFile
.
open
(
QIODevice
::
ReadWrite
))
{
qWarning
(
"Failed to open '%s': %s"
,
qPrintable
(
proFileNode
->
path
()),
qPrintable
(
proFile
.
errorString
()));
return
false
;
}
QByteArray
proFileContents
=
proFile
.
readAll
();
proFileContents
+=
"
\n
maemo5|maemp6{
\n
"
" desktopfile.files = $${TARGET}.desktop
\n
"
" desktopfile.path = /usr/share/applications/hildon
\n
"
" INSTALLS += desktopfile
\n
}
\n
"
;
proFile
.
resize
(
0
);
proFile
.
write
(
proFileContents
);
proFile
.
close
();
if
(
proFile
.
error
()
!=
QFile
::
NoError
)
{
qWarning
(
"Could not write '%s': %s"
,
qPrintable
(
proFileNode
->
path
()),
qPrintable
(
proFile
.
errorString
()));
return
false
;
}
}
return
true
;
}
void
MaemoTemplatesManager
::
handleProjectToBeRemoved
(
ProjectExplorer
::
Project
*
project
)
...
...
Write
Preview
Markdown
is supported
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