Editing QtComponents/Miniature

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
'''Miniature''' is a chess game currently maintained by Michael Hasselmann and Quim Gil and targeted to Harmattan devices. See more about it on [[Miniature]] page.
'''Miniature''' is a chess game currently maintained by Michael Hasselmann and Quim Gil and targeted to Harmattan devices. See more about it on [[Miniature]] page.
-
I'm going to make use of this project as an example of the required changes to get it working on Fremantle
+
I'm going to make this project as an example of the required changes to get it working on Fremantle
== Fetch sources ==
== Fetch sources ==
Line 22: Line 22:
|}
|}
-
=== Change meego namespace by fremantle one ===
+
=== Change meego namesapce by fremantle one ===
There is a simple script to do this task located at [https://qt.gitorious.org/~inean/qt-components/ineans-qt-components/blobs/fremantle-1.0/src/fremantle/migrateTo gitorious]. invoke inside miniature directory as:
There is a simple script to do this task located at [https://qt.gitorious.org/~inean/qt-components/ineans-qt-components/blobs/fremantle-1.0/src/fremantle/migrateTo gitorious]. invoke inside miniature directory as:
Line 35: Line 35:
== Handle Close events ==
== Handle Close events ==
-
QtComponents uses Qt.quit() event to notify application backends that user has requested to close window. Miniature doesn't handle this event on its own, so we need to add it.
 
-
 
-
First, lookup for a DeclarativeView or 'show' call inside miniature directory. A '''grep''' command point us to miniature.cc file. We add a close Slot to deal with Qt.quit() event.
 
<syntaxhighlight lang="diff">
<syntaxhighlight lang="diff">
Line 61: Line 58:
+{
+{
+    Q_D(Miniature);
+    Q_D(Miniature);
-
+    d->command_line.processToken(QByteArray("quit"));
 
-
+}
 
+
+
void Miniature::show(const QUrl &ui)
void Miniature::show(const QUrl &ui)
Line 81: Line 76:
</syntaxhighlight>
</syntaxhighlight>
-
commit
 
-
 
-
== Adapt deployment to Fremantle ==
 
-
Some changes on how miniature is deployed are needed to match Fremantle.
 
-
 
-
=== Optify code ===
 
-
use a PREFIX config variable to change default target dir from /usr to /opt. Also update locations of desktop and icon applications
 
<syntaxhighlight lang="diff">
<syntaxhighlight lang="diff">
Line 108: Line 96:
     DEFINES += MINIATURE_GUI_ENABLED
     DEFINES += MINIATURE_GUI_ENABLED
  }
  }
-
  diff --git a/src/src.pro b/src/src.pro
+
diff --git a/miniature.desktop b/miniature.desktop
-
index fca7c29..bf35139 100644
+
index dc88397..9f29209 100644
 +
--- a/miniature.desktop
 +
+++ b/miniature.desktop
 +
@@ -4,5 +4,5 @@ Version=1.0
 +
  Terminal=false
 +
Type=Application
 +
Name=Miniature
 +
-Exec=invoker --single-instance --type=d /usr/games/miniature
 +
-Icon=/usr/share/themes/base/meegotouch/icons/miniature-n9.png
 +
+Exec=/opt/games/miniature
 +
+Icon=miniature-n9
 +
diff --git a/src/src.pro b/src/src.pro
 +
index 1b1356c..f42a6f9 100644
--- a/src/src.pro
--- a/src/src.pro
+++ b/src/src.pro
+++ b/src/src.pro
-
@@ -89,7 +89,7 @@ LIBS += \
+
@@ -95,7 +95,7 @@ LIBS += \
   
   
  }
  }
 +
-target.path = /usr/games
-target.path = /usr/games
+target.path = $${PREFIX}/games
+target.path = $${PREFIX}/games
Line 129: Line 130:
  icon.files = $${TARGET}-n9.png
  icon.files = $${TARGET}-n9.png
-icon.path = /usr/share/themes/base/meegotouch/icons/
-icon.path = /usr/share/themes/base/meegotouch/icons/
-
+icon.path = /usr/share/icons/hicolor/64x64/
+
+icon.path = $${PREFIX}/share/icons/hicolor/64x64/
   
   
  INSTALLS += \
  INSTALLS += \
Line 135: Line 136:
</syntaxhighlight>
</syntaxhighlight>
-
=== Update Desktop file ===
 
-
And finally, update desktop file. There's no applauncerd on fremantle, so remove invoker from Exec.
 
-
<syntaxhighlight lang="diff">
 
-
diff --git a/miniature.desktop b/miniature.desktop
 
-
index dc88397..9f29209 100644
 
-
--- a/miniature.desktop
 
-
+++ b/miniature.desktop
 
-
@@ -4,5 +4,5 @@ Version=1.0
 
-
Terminal=false
 
-
Type=Application
 
-
Name=Miniature
 
-
-Exec=invoker --single-instance --type=d /usr/games/miniature
 
-
-Icon=/usr/share/themes/base/meegotouch/icons/miniature-n9.png
 
-
+Exec=/opt/games/miniature
 
-
+Icon=miniature-n9
 
-
diff --git a/src/src.pro b/src/src.pro
 
-
index 1b1356c..f42a6f9 100644
 
-
--- a/src/src.pro
 
-
+++ b/src/src.pro
 
-
@@ -95,7 +95,7 @@ LIBS += \
 
-
 
-
}
 
-
</syntaxhighlight>
 
-
commit
 
== Update packing scripts ==
== Update packing scripts ==
-
Now that all required changes are commited. generate patches with
 
-
<syntaxhighlight lang="bash">git format-patch origin/master</syntaxhighlight>
 
-
and copy generated files into debian/patches directory.
 
-
 
-
Finally, modify rules file at debian directory to merge patches. At '''config-stamp''' rule add:
 
-
<syntaxhighlight lang="make">for p in debian/patches/*; do patch -p1 < $$p; done
 
-
</syntaxhighlight>
 
-
 
-
And thats all. You have upstream '''miniature''' working on Maemo5
 

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)