rpms/merkaartor/devel merkaartor-0.11-fixes.patch, NONE, 1.1 merkaartor.spec, 1.4, 1.5

Sven Lankes slankes at fedoraproject.org
Wed Sep 10 18:52:36 UTC 2008


Author: slankes

Update of /cvs/pkgs/rpms/merkaartor/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv7046

Modified Files:
	merkaartor.spec 
Added Files:
	merkaartor-0.11-fixes.patch 
Log Message:
Add patch from -fixes svn-branch to allow trackpoints as nodes on upload


merkaartor-0.11-fixes.patch:

--- NEW FILE merkaartor-0.11-fixes.patch ---
diff -uprN -x .svn -x Icons merkaartor-orig/CHANGELOG merkaartor-0.11-fixes/CHANGELOG
--- merkaartor-orig/CHANGELOG	2008-07-28 22:34:08.000000000 +0200
+++ merkaartor-0.11-fixes/CHANGELOG	2008-09-10 20:32:16.000000000 +0200
@@ -1,3 +1,6 @@
+v0.11.1
+	* FIX : manage road conflicts from downloads
+	* FIX : 412 when uploading joined/splitted roads (closes #948)
 v0.11
 	* FIX : updated Czech translation file
 	* ADD : Export to KML
diff -uprN -x .svn -x Icons merkaartor-orig/Command/DocumentCommands.cpp merkaartor-0.11-fixes/Command/DocumentCommands.cpp
--- merkaartor-orig/Command/DocumentCommands.cpp	2008-07-18 00:47:04.000000000 +0200
+++ merkaartor-0.11-fixes/Command/DocumentCommands.cpp	2008-09-10 20:32:16.000000000 +0200
@@ -151,8 +151,8 @@ bool RemoveFeatureCommand::buildDirtyLis
 	if (theFeature->lastUpdated() == MapFeature::OSMServerConflict)
 		return false;
 
-	if (!theFeature->hasOSMId())
-		return false;
+	//if (!theFeature->hasOSMId())
+	//	return false;
 
 	if (CascadedCleanUp && CascadedCleanUp->buildDirtyList(theList))
 	{
diff -uprN -x .svn -x Icons merkaartor-orig/Command/RoadCommands.cpp merkaartor-0.11-fixes/Command/RoadCommands.cpp
--- merkaartor-orig/Command/RoadCommands.cpp	2008-07-03 10:22:31.000000000 +0200
+++ merkaartor-0.11-fixes/Command/RoadCommands.cpp	2008-09-10 20:32:16.000000000 +0200
@@ -137,7 +137,7 @@ bool RoadRemoveTrackPointCommand::buildD
 {
 	if (!theRoad->layer())
 		return theList.update(theRoad);
-	if (theRoad->layer()->isUploadable() && theTrackPoint->layer()->isUploadable())
+	if (theRoad->layer()->isUploadable() && (theTrackPoint->layer()->isUploadable() || theTrackPoint->hasOSMId()))
 		return theList.update(theRoad);
 	else
 		return false;
diff -uprN -x .svn -x Icons merkaartor-orig/Map/ImportOSM.cpp merkaartor-0.11-fixes/Map/ImportOSM.cpp
--- merkaartor-orig/Map/ImportOSM.cpp	2008-07-17 15:34:38.000000000 +0200
+++ merkaartor-0.11-fixes/Map/ImportOSM.cpp	2008-09-10 20:32:16.000000000 +0200
@@ -103,8 +103,6 @@ void OSMHandler::parseNd(const QXmlAttri
 	if (!R) return;
 	TrackPoint *Part = MapFeature::getTrackPointOrCreatePlaceHolder(theDocument, theLayer, theList, atts.value("ref"));
 	if (NewFeature)
-		R->add(Part);
-	else
 		theList->add(new RoadAddTrackPointCommand(R,Part));
 }
 
@@ -120,21 +118,25 @@ void OSMHandler::parseWay(const QXmlAttr
 			R->setLastUpdated(MapFeature::UserResolved);
 			NewFeature = false;
 			// conflict
-/*				TrackPoint* Conflict = dynamic_cast<TrackPoint*>(theDocument->get("conflict_node_"+Root.attribute("from")));
-			if (Conflict) From = Conflict;
-			Conflict = dynamic_cast<TrackPoint*>(theDocument->get("conflict_node_"+Root.attribute("to")));
-			if (Conflict) To = Conflict;
-			Way* W = new Way(From,To);
-			W->setId("conflict_"+id);
-			loadSegmentTags(Root,W);
-			theList->add(new AddFeatureCommand(conflictLayer,W, false));
-			W->setLastUpdated(MapFeature::OSMServerConflict); */
+			Road* userRd = R;
+			R = new Road();
+			R->setId("conflict_"+id);
+			R->setLastUpdated(MapFeature::OSMServerConflict);
+			parseStandardAttributes(atts,R);
+			if (R->time() > userRd->time()) {
+				theList->add(new AddFeatureCommand(conflictLayer, R, false));
+				NewFeature = true;
+			} else {
+				delete R;
+				R = userRd;
+				NewFeature = false;
+			}
 		}
 		else if (R->lastUpdated() != MapFeature::UserResolved)
 		{
 			while (R->size())
 				theList->add(new RoadRemoveTrackPointCommand(R,R->get(0)));
-			NewFeature = false;
+			NewFeature = true;
 		}
 	}
 	else
@@ -376,6 +378,15 @@ bool importOSM(QWidget* aParent, QIODevi
 		if (!conflictLayer->size()) {
 			theDocument->remove(conflictLayer);
 			delete conflictLayer;
+		} else {
+			QMessageBox::warning(aParent,QApplication::translate("Downloader","Conflicts have been detected"), 
+				QApplication::translate("Downloader",
+				"This means that some of the feature you modified"
+				" since your last download have since been modified by someone else on the server.\n"
+				"The features have been duplicated as \"conflict_...\" on the \"Conflicts...\" layer.\n"
+				"Before being able to upload your changes, you will have to manually merge the two versions"
+				" and remove the one from the \"Conflicts...\" layer."
+				));
 		}
 	}
 	return true;
diff -uprN -x .svn -x Icons merkaartor-orig/Map/Road.cpp merkaartor-0.11-fixes/Map/Road.cpp
--- merkaartor-orig/Map/Road.cpp	2008-07-24 15:14:40.000000000 +0200
+++ merkaartor-0.11-fixes/Map/Road.cpp	2008-09-10 20:32:16.000000000 +0200
@@ -357,6 +357,9 @@ void Road::cascadedRemoveIfUsing(MapDocu
 
 bool Road::deleteChildren(MapDocument* theDocument, CommandList* theList)
 {
+	if (lastUpdated() == MapFeature::OSMServerConflict)
+		return true;
+
 	QMessageBox::StandardButton resp = QMessageBox::question(NULL, MainWindow::tr("Delete Children"),
 								 MainWindow::tr("Do you want to delete the children nodes also?"),
 								 QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, QMessageBox::Yes);
@@ -409,6 +412,7 @@ bool Road::toXML(QDomElement xParent)
 	e.setAttribute("id", xmlId());
 	e.setAttribute("timestamp", time().toString(Qt::ISODate)+"Z");
 	e.setAttribute("user", user());
+	e.setAttribute("actor", (int)lastUpdated());
 
 	for (unsigned int i=0; i<size(); ++i) {
 		QDomElement n = xParent.ownerDocument().createElement("nd");
@@ -429,14 +433,24 @@ Road * Road::fromXML(MapDocument* d, Map
 		id = "way_" + id;
 	QDateTime time = QDateTime::fromString(e.attribute("timestamp").left(19), "yyyy-MM-ddTHH:mm:ss");
 	QString user = e.attribute("user");
+	MapFeature::ActorType A;
+	if (e.hasAttribute("actor"))
+		A = (MapFeature::ActorType)(e.attribute("actor", "2").toInt());
+	else
+		if (L = d->getDirtyLayer())
+			A = MapFeature::User;
+		else
+			A = MapFeature::OSMServer;
 
 	Road* R = dynamic_cast<Road*>(d->getFeature(id));
 
 	if (!R) {
 		R = new Road();
 		R->setId(id);
-		R->setLastUpdated(MapFeature::OSMServer);
+		R->setLastUpdated(A);
 	} else {
+		if (R->lastUpdated() == MapFeature::NotYetDownloaded)
+			R->setLastUpdated(A);
 		R->layer()->remove(R);
 	}
 	R->setTime(time);


Index: merkaartor.spec
===================================================================
RCS file: /cvs/pkgs/rpms/merkaartor/devel/merkaartor.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- merkaartor.spec	28 Aug 2008 19:34:49 -0000	1.4
+++ merkaartor.spec	10 Sep 2008 18:52:06 -0000	1.5
@@ -1,6 +1,6 @@
 Name:           merkaartor
 Version:        0.11
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Qt-Based OpenStreetMap editor
 
 Group:          Applications/Productivity
@@ -9,6 +9,7 @@
 Source0:        http://www.irule.be/pipe/Merkaartor-0.11.tar.bz2
 Source1:        %{name}.desktop
 Source2:        %{name}.xpm
+Patch0:         %{name}-%{version}-fixes.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  qt4-devel >= 4.4
@@ -23,6 +24,7 @@
 
 %prep
 %setup -q -n %{name}
+%patch0 -p1
 sed -i 's/CONFIG += debug/CONFIG += release/' Merkaartor.pro
 chmod 644 LICENSE
 find -name "*.[ch]" -exec %{__chmod} -x '{}' \;   
@@ -58,6 +60,9 @@
 
 
 %changelog
+* Wed Sep 10 2008 Sven Lankes <sven at lank.es> - 0.11-3
+- add patch from -fixes branch (fixes upload error)
+
 * Thu Aug 28 2008 Michael Schwendt <mschwendt at fedoraproject.org> - 0.11-2
 - include unowned directories
 




More information about the fedora-extras-commits mailing list