[PC-BSD Commits] r465 - pcbsd/trunk/kcmPBSystem

svn at pcbsd.org svn at pcbsd.org
Thu Jul 12 15:02:46 PDT 2007


Author: tim
Date: 2007-07-12 23:02:46 +0100 (Thu, 12 Jul 2007)
New Revision: 465

Modified:
   pcbsd/trunk/kcmPBSystem/cvsupprogress.ui
   pcbsd/trunk/kcmPBSystem/cvsupprogress.ui.h
   pcbsd/trunk/kcmPBSystem/portsnapprogress.ui.h
Log:
If the specified supfile doesn't exist, copy the FreeBSD example into its place so we can modify that.

Modified: pcbsd/trunk/kcmPBSystem/cvsupprogress.ui
===================================================================
--- pcbsd/trunk/kcmPBSystem/cvsupprogress.ui	2007-07-12 21:32:26 UTC (rev 464)
+++ pcbsd/trunk/kcmPBSystem/cvsupprogress.ui	2007-07-12 22:02:46 UTC (rev 465)
@@ -140,6 +140,7 @@
     <include location="local" impldecl="in declaration">qprocess.h</include>
     <include location="local" impldecl="in declaration">fastestcvsup.h</include>
     <include location="global" impldecl="in declaration">kmessagebox.h</include>
+    <include location="global" impldecl="in declaration">kio/job.h</include>
     <include location="local" impldecl="in implementation">cvsupprogress.ui.h</include>
 </includes>
 <variables>

Modified: pcbsd/trunk/kcmPBSystem/cvsupprogress.ui.h
===================================================================
--- pcbsd/trunk/kcmPBSystem/cvsupprogress.ui.h	2007-07-12 21:32:26 UTC (rev 464)
+++ pcbsd/trunk/kcmPBSystem/cvsupprogress.ui.h	2007-07-12 22:02:46 UTC (rev 465)
@@ -13,14 +13,14 @@
 
 void CVSUpProgress::setup( QString task, QString supfile )
 {
+    qDebug("Using supfile: " + supfile);
     QString captionText = this->caption();
     captionText += " - ";
     captionText += task;
     this->setCaption(captionText);
-    
+    this->supfile = supfile;
+    if (! QFile::exists(this->supfile)) {  KIO::file_copy("/usr/share/examples/cvsup/standard-supfile", this->supfile, -1, false); }
     progressLabel->setText(tr("Selected CVSup server: ") + getServer());
-    
-    this->supfile = supfile;
 }
 
 
@@ -94,7 +94,7 @@
 
 void CVSUpProgress::writeServer(QString server)
 {
-    QFile supfile("/root/standard-supfile");
+    QFile supfile(this->supfile);
     QStringList lines;
     if (supfile.open(IO_ReadOnly))
     {
@@ -122,7 +122,7 @@
 {
     QString result = "UNSET";
     
-    QFile supfile("/root/standard-supfile");
+    QFile supfile(this->supfile);
     if (supfile.open(IO_ReadOnly))
     {
 	QTextStream stream(&supfile);
@@ -130,7 +130,7 @@
 	while (! stream.atEnd())
 	{
 	    line = stream.readLine();
-	    if (line.contains("*default host=")) { result = QStringList::split("=", line)[1]; }
+	    if (line.contains("*default host=")  && !(line.contains("CHANGE_THIS"))) { result = QStringList::split("=", line)[1]; }
 	}
     }
     supfile.close();

Modified: pcbsd/trunk/kcmPBSystem/portsnapprogress.ui.h
===================================================================
--- pcbsd/trunk/kcmPBSystem/portsnapprogress.ui.h	2007-07-12 21:32:26 UTC (rev 464)
+++ pcbsd/trunk/kcmPBSystem/portsnapprogress.ui.h	2007-07-12 22:02:46 UTC (rev 465)
@@ -104,8 +104,10 @@
     }
     else {
 	displayString += output;
-        if (output.at(output.length() - 2).isDigit()) {
-	    numberSteps = output.at(output.length() - 2).digitValue();
+	QStringList outputSplit = QStringList::split(" ", output);
+	if (outputSplit[1].toInt() != 0)
+	{
+	    numberSteps += outputSplit[1].toInt();
 	}
 	//Detect 'fetching n patches' condition
 	if ((output.find("patches") != -1) && (output.find("Applying") == -1)) {
@@ -161,10 +163,9 @@
 	QString args = "update";
 	if (firstRun) {
 	    args = "first";
+	    numberSteps = 0;
 	}
 	
-	numberSteps = 0;
-	
 	portsnap = new QProcess(this);
 	portsnap->addArgument("/PCBSD/Scripts/System/changes.sh");
 	portsnap->addArgument(args);



More information about the Commits mailing list