Branch: master

a027ac32 2014-07-12 17:17:09 Timothy Pearson
Fully fix damage from prior incorrect commit
M tdeioslave/media/mediamanager/tdehardwarebackend.cpp
diff --git a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
index 0252fb1..a79f052 100644
--- a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
+++ b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
@@ -174,7 +174,7 @@
 					medium->setHidden(false);
 				}
 			}
-			
+
 			// Insert medium into list
 			m_mediaList.addMedium(medium, allowNotification);
 
@@ -217,7 +217,7 @@
 		// Create medium
 		Medium* medium = new Medium(sdevice->uniqueID(), driveUDIFromDeviceUID(sdevice->uniqueID()), "");
 		setVolumeProperties(medium);
-		
+
 		// Insert medium into list
 		m_mediaList.addMedium(medium, allowNotification);
 
@@ -246,7 +246,7 @@
 			&& !(sdevice->isDiskOfType(TDEDiskDeviceType::Floppy))
 			&& !(sdevice->checkDiskStatus(TDEDiskDeviceStatus::Blank))
 			) {
-			// 
+			//
 		}
 		else {
 			// Create medium
@@ -392,7 +392,7 @@
 			&& !(sdevice->isDiskOfType(TDEDiskDeviceType::Floppy))
 			&& !(sdevice->checkDiskStatus(TDEDiskDeviceStatus::Blank))
 			) {
-			// 
+			//
 		}
 		else {
 			// Do not list the LUKS backend device if it has been unlocked elsewhere
@@ -542,7 +542,7 @@
 				diskLabel = i18n("Blank Mount Ranier CD-RW-W");
 			}
 		}
-	
+
 		if (sdevice->isDiskOfType(TDEDiskDeviceType::DVDROM)) {
 			mimeType = "media/dvd" + MOUNT_SUFFIX;
 			if (sdevice->checkDiskStatus(TDEDiskDeviceStatus::Blank)) {
@@ -551,7 +551,7 @@
 				diskLabel = i18n("Blank DVD-ROM");
 			}
 		}
-	
+
 		if (sdevice->isDiskOfType(TDEDiskDeviceType::DVDRAM)) {
 			mimeType = "media/dvd" + MOUNT_SUFFIX;
 			if (sdevice->checkDiskStatus(TDEDiskDeviceStatus::Blank)) {
@@ -686,7 +686,7 @@
 				diskLabel = i18n("Blank HDDVD-RW");
 			}
 		}
-	
+
 		if (sdevice->isDiskOfType(TDEDiskDeviceType::CDAudio)) {
 			mimeType = "media/audiocd";
 			medium->unmountableState("audiocd:/?device=" + sdevice->deviceNode());
@@ -702,7 +702,7 @@
 		if (sdevice->isDiskOfType(TDEDiskDeviceType::BDVideo)) {
 			mimeType = "media/bdvideo";
 		}
-	
+
 		medium->setIconName(TQString::null);
 	}
 	else {
@@ -790,7 +790,7 @@
 		else {
 			medium->setEncrypted(false);
 		}
-	
+
 		// USAGE: mountableState(Device node, Mount point, Filesystem type, Mounted ?)
 		medium->mountableState(sdevice->deviceNode(), sdevice->mountPath(), sdevice->fileSystemName(), !sdevice->mountPath().isNull());
 	}
@@ -825,11 +825,11 @@
 		}
 		medium->setLabel(diskLabel);
 	}
-	
+
 	/** @todo Mimetype for JAZ drives ? */
-	
+
 	medium->setIconName(TQString::null);
-	
+
 	return true;
 }
 
@@ -873,7 +873,7 @@
 	KMountPoint::List mtab = KMountPoint::currentMountPoints();
 	KMountPoint::List::iterator it = mtab.begin();
 	KMountPoint::List::iterator end = mtab.end();
-	
+
 	TQString fstype;
 	TQString mountpoint;
 	for (; it!=end; ++it) {
@@ -1110,36 +1110,36 @@
 	TQString drive_udi = driveUDIFromDeviceUID(medium->id());
 
 	kdDebug(1219) << "setMountoptions " << name << " " << options << endl;
-	
+
 	TDEConfig config("mediamanagerrc");
 	config.setGroup(drive_udi);
-	
+
 	TQMap<TQString,TQString> valids = MediaManagerUtils::splitOptions(options);
-	
+
 	const char *names[] = { "use_defaults", "ro", "quiet", "atime", "uid", "utf8", "flush", "sync", 0 };
 	for (int index = 0; names[index]; ++index) {
 		if (valids.contains(names[index])) {
 			config.writeEntry(names[index], valids[names[index]] == "true");
 		}
 	}
-	
+
 	if (valids.contains("shortname")) {
 		config.writeEntry("shortname", valids["shortname"]);
 	}
-	
+
 	if (valids.contains("journaling")) {
 		config.writeEntry("journaling", valids["journaling"]);
 	}
-	
+
 	if (!mountoptions(name).contains(TQString("mountpoint=%1").arg(valids["mountpoint"]))) {
 		config.writeEntry("mountpoint", valids["mountpoint"]);
 	}
-	
+
 	if (valids.contains("automount")) {
 		config.setGroup(drive_udi);
 		config.writeEntry("automount", valids["automount"]);
 	}
-	
+
 	return true;
 }
 
@@ -1158,14 +1158,14 @@
 	if (medium->isMounted()) {
 		return TQString(); // that was easy
 	}
-	
+
 	TQString mountPoint = isInFstab(medium);
 	if (!mountPoint.isNull())
 	{
 		struct mount_job_data data;
 		data.completed = false;
 		data.medium = medium;
-		
+
 		TDEIO::Job *job = TDEIO::mount( false, 0, medium->deviceNode(), mountPoint );
 		connect(job, TQT_SIGNAL( result (TDEIO::Job *)), TQT_SLOT( slotResult( TDEIO::Job *)));
 		mount_jobs[job] = &data;
@@ -1176,7 +1176,7 @@
 		}
 		// Return the error message (if any) to the caller
 		return (data.error) ? data.errorMessage : TQString::null;
-		
+
 	}
 
 	TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices();
@@ -1187,9 +1187,9 @@
 	}
 
 	TQString diskLabel;
-	
+
 	TQMap<TQString,TQString> valids = MediaManagerUtils::splitOptions(mountoptions(medium->id()));
-	
+
 	TQString mount_point = valids["mountpoint"];
 	if (mount_point.startsWith("/media/")) {
 		diskLabel = mount_point.mid(7);
@@ -1202,7 +1202,7 @@
 		diskLabel = medium->label() + " (" + node + ")";
 		diskLabel.replace("/", "_");
 	}
-	
+
 	TQString qerror = i18n("Cannot mount encrypted drives!");
 
 	if (!medium->isEncrypted()) {
@@ -1234,7 +1234,7 @@
 
 			m_decryptDialog = new Dialog(sdevice->deviceNode(), iconName);
 			m_decryptDialog->show();
-	
+
 			connect(m_decryptDialog, TQT_SIGNAL (user1Clicked()), this, TQT_SLOT (slotPasswordReady()));
 			connect(m_decryptDialog, TQT_SIGNAL (cancelClicked()), this, TQT_SLOT (slotPasswordCancel()));
 			connect(this, TQT_SIGNAL (signalDecryptionPasswordError(TQString)), m_decryptDialog, TQT_SLOT (slotDialogError(TQString)));
@@ -1322,18 +1322,18 @@
 	if (!medium) {
 		return i18n("No such medium: %1").arg(_udi);
 	}
-	
+
 	return mount(medium);
 }
 
 TQString TDEBackend::unmount(const TQString &_udi)
 {
 	const Medium* medium = m_mediaList.findById(_udi);
-	
+
 	if ( !medium ) {
 		return i18n("No such medium: %1").arg(_udi);
 	}
-	
+
 	if (!medium->isMounted()) {
 		return TQString(); // that was easy
 	}
@@ -1344,7 +1344,7 @@
 		struct mount_job_data data;
 		data.completed = false;
 		data.medium = medium;
-		
+
 		TDEIO::Job *job = TDEIO::unmount( medium->mountPoint(), false );
 		connect(job, TQT_SIGNAL( result (TDEIO::Job *)), TQT_SLOT( slotResult( TDEIO::Job *)));
 		mount_jobs[job] = &data;
@@ -1507,7 +1507,7 @@
 		while (!is.atEnd()) {
 			tmp = is.readLine();
 			tmp = TQStyleSheet::escape(tmp) + "\n";
-		
+
 			proclist += tmp;
 			if (counter++ > 10) {
 				proclist += "...";
 ** Diff limit reached (max: 250 lines) **