Browse Source

Renamed methods decrypt/undecrypt to unlock/lock.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
undefined
Michele Calgaro 1 month ago
parent
commit
73753b8591
Signed by: Michele Calgaro <michele.calgaro@yahoo.it> GPG Key ID: 2A75B7CA8ADED5CF

+ 8
- 8
tdeioslave/media/mediamanager/halbackend.cpp View File

@@ -1804,7 +1804,7 @@ TQStringVariantMap HALBackend::unmount(const TQString &id)
1804 1804
     return result;
1805 1805
 }
1806 1806
 
1807
-TQStringVariantMap HALBackend::decrypt(const TQString &id, const TQString &password)
1807
+TQStringVariantMap HALBackend::unlock(const TQString &id, const TQString &password)
1808 1808
 {
1809 1809
     TQStringVariantMap result;
1810 1810
 
@@ -1831,7 +1831,7 @@ TQStringVariantMap HALBackend::decrypt(const TQString &id, const TQString &passw
1831 1831
                                         "org.freedesktop.Hal.Device.Volume.Crypto",
1832 1832
                                         "Setup");
1833 1833
     if (msg == NULL) {
1834
-        kdDebug() << "decrypt failed for " << udi << ": could not create dbus message\n";
1834
+        kdDebug() << "unlock failed for " << udi << ": could not create dbus message\n";
1835 1835
         result["errStr"] = i18n("Internal error");
1836 1836
         result["result"] = false;
1837 1837
         return result;
@@ -1840,7 +1840,7 @@ TQStringVariantMap HALBackend::decrypt(const TQString &id, const TQString &passw
1840 1840
     TQCString pwdUtf8 = password.utf8();
1841 1841
     const char *pwd_utf8 = pwdUtf8;
1842 1842
     if (!dbus_message_append_args (msg, DBUS_TYPE_STRING, &pwd_utf8, DBUS_TYPE_INVALID)) {
1843
-        kdDebug() << "decrypt failed for " << udi << ": could not append args to dbus message\n";
1843
+        kdDebug() << "unlock failed for " << udi << ": could not append args to dbus message\n";
1844 1844
         dbus_message_unref (msg);
1845 1845
         result["errStr"] = i18n("Internal error");
1846 1846
         result["result"] = false;
@@ -1852,7 +1852,7 @@ TQStringVariantMap HALBackend::decrypt(const TQString &id, const TQString &passw
1852 1852
         dbus_error_is_set (&error))
1853 1853
     {
1854 1854
         TQString qerror = i18n("Internal Error");
1855
-        kdDebug() << "decrypt failed for " << udi << ": " << error.name << " " << error.message << endl;
1855
+        kdDebug() << "unlock failed for " << udi << ": " << error.name << " " << error.message << endl;
1856 1856
         if (strcmp (error.name, "org.freedesktop.Hal.Device.Volume.Crypto.SetupPasswordError") == 0) {
1857 1857
             qerror = i18n("Wrong password");
1858 1858
         }
@@ -1873,7 +1873,7 @@ TQStringVariantMap HALBackend::decrypt(const TQString &id, const TQString &passw
1873 1873
     return result;
1874 1874
 }
1875 1875
 
1876
-TQStringVariantMap HALBackend::undecrypt(const TQString &id)
1876
+TQStringVariantMap HALBackend::lock(const TQString &id)
1877 1877
 {
1878 1878
     TQStringVariantMap result;
1879 1879
 
@@ -1900,14 +1900,14 @@ TQStringVariantMap HALBackend::undecrypt(const TQString &id)
1900 1900
                                         "org.freedesktop.Hal.Device.Volume.Crypto",
1901 1901
                                         "Teardown");
1902 1902
     if (msg == NULL) {
1903
-        kdDebug() << "teardown failed for " << udi << ": could not create dbus message\n";
1903
+        kdDebug() << "lock failed for " << udi << ": could not create dbus message\n";
1904 1904
         result["errStr"] = i18n("Internal error");
1905 1905
         result["result"] = false;
1906 1906
         return result;
1907 1907
     }
1908 1908
 
1909 1909
     if (!dbus_message_append_args (msg, DBUS_TYPE_INVALID)) {
1910
-        kdDebug() << "teardown failed for " << udi << ": could not append args to dbus message\n";
1910
+        kdDebug() << "lock failed for " << udi << ": could not append args to dbus message\n";
1911 1911
         dbus_message_unref (msg);
1912 1912
         result["errStr"] = i18n("Internal error");
1913 1913
         result["result"] = false;
@@ -1919,7 +1919,7 @@ TQStringVariantMap HALBackend::undecrypt(const TQString &id)
1919 1919
         dbus_error_is_set (&error))
1920 1920
     {
1921 1921
         TQString qerror = i18n("Internal Error");
1922
-        kdDebug() << "teardown failed for " << udi << ": " << error.name << " " << error.message << endl;
1922
+        kdDebug() << "lock failed for " << udi << ": " << error.name << " " << error.message << endl;
1923 1923
         dbus_error_free (&error);
1924 1924
         dbus_message_unref (msg);
1925 1925
         while (dbus_connection_dispatch(dbus_connection) == DBUS_DISPATCH_DATA_REMAINS) ;

+ 2
- 2
tdeioslave/media/mediamanager/halbackend.h View File

@@ -86,8 +86,8 @@ public:
86 86
 	TQStringVariantMap mount(const TQString &id);
87 87
 	TQStringVariantMap mount(const Medium *medium);
88 88
 	TQStringVariantMap unmount(const TQString &id);
89
-	TQStringVariantMap decrypt(const TQString &id, const TQString &password);
90
-	TQStringVariantMap undecrypt(const TQString &id);
89
+	TQStringVariantMap unlock(const TQString &id, const TQString &password);
90
+	TQStringVariantMap lock(const TQString &id);
91 91
 
92 92
 private:
93 93
 	/**

+ 12
- 12
tdeioslave/media/mediamanager/mediamanager.cpp View File

@@ -294,7 +294,7 @@ TQStringVariantMap MediaManager::unmount(const TQString &uid)
294 294
 #endif
295 295
 }
296 296
 
297
-TQStringVariantMap MediaManager::decrypt(const TQString &uid, const TQString &password)
297
+TQStringVariantMap MediaManager::unlock(const TQString &uid, const TQString &password)
298 298
 {
299 299
 	TQStringVariantMap result;
300 300
 /*
@@ -304,7 +304,7 @@ TQStringVariantMap MediaManager::decrypt(const TQString &uid, const TQString &pa
304 304
 		result["result"] = false;
305 305
 		return result;
306 306
 	}
307
-	return m_tdebackend->decrypt(uid, password);
307
+	return m_tdebackend->unlock(uid, password);
308 308
 #elif defined COMPILE_HALBACKEND
309 309
 */
310 310
 #if defined COMPILE_HALBACKEND
@@ -313,7 +313,7 @@ TQStringVariantMap MediaManager::decrypt(const TQString &uid, const TQString &pa
313 313
 		result["result"] = false;
314 314
 		return result;
315 315
 	}
316
-	return m_halbackend->decrypt(uid, password);
316
+	return m_halbackend->unlock(uid, password);
317 317
 
318 318
 #else
319 319
 //	if (!m_fstabbackend) {
@@ -321,11 +321,11 @@ TQStringVariantMap MediaManager::decrypt(const TQString &uid, const TQString &pa
321 321
 		result["result"] = false;
322 322
 		return result;
323 323
 //	}
324
-//	return m_fstabbackend->decrypt(uid, password);
324
+//	return m_fstabbackend->unlock(uid, password);
325 325
 #endif
326 326
 }
327 327
 
328
-TQStringVariantMap MediaManager::undecrypt(const TQString &uid)
328
+TQStringVariantMap MediaManager::lock(const TQString &uid)
329 329
 {
330 330
 	TQStringVariantMap result;
331 331
 /*
@@ -335,7 +335,7 @@ TQStringVariantMap MediaManager::undecrypt(const TQString &uid)
335 335
 		result["result"] = false;
336 336
 		return result;
337 337
 	}
338
-	return m_tdebackend->undecrypt(uid);
338
+	return m_tdebackend->lock(uid);
339 339
 #elif defined COMPILE_HALBACKEND
340 340
 */
341 341
 #if defined COMPILE_HALBACKEND
@@ -344,14 +344,14 @@ TQStringVariantMap MediaManager::undecrypt(const TQString &uid)
344 344
 		result["result"] = false;
345 345
 		return result;
346 346
 	}
347
-	return m_halbackend->undecrypt(uid);
347
+	return m_halbackend->lock(uid);
348 348
 #else
349 349
 //	if (!m_fstabbackend) {
350 350
 		result["errStr"] = i18n("Feature only available with HAL or TDE hardware backend");
351 351
 		result["result"] = false;
352 352
 		return result;
353 353
 //	}
354
-//	return m_fstabbackend->undecrypt(uid);
354
+//	return m_fstabbackend->lock(uid);
355 355
 #endif
356 356
 }
357 357
 
@@ -379,7 +379,7 @@ TQStringVariantMap MediaManager::unmountByNode(const TQString &deviceNode)
379 379
 	return unmount(medium->id());
380 380
 }
381 381
 
382
-TQStringVariantMap MediaManager::decryptByNode(const TQString &deviceNode, const TQString &password)
382
+TQStringVariantMap MediaManager::unlockByNode(const TQString &deviceNode, const TQString &password)
383 383
 {
384 384
 	const Medium *medium = m_mediaList.findByNode(deviceNode);
385 385
 	if (!medium) {
@@ -388,10 +388,10 @@ TQStringVariantMap MediaManager::decryptByNode(const TQString &deviceNode, const
388 388
 		result["result"] = false;
389 389
 		return result;
390 390
 	}
391
-	return decrypt(medium->id(), password);
391
+	return unlock(medium->id(), password);
392 392
 }
393 393
 
394
-TQStringVariantMap MediaManager::undecryptByNode(const TQString &deviceNode)
394
+TQStringVariantMap MediaManager::lockByNode(const TQString &deviceNode)
395 395
 {
396 396
 	const Medium *medium = m_mediaList.findByNode(deviceNode);
397 397
 	if (!medium) {
@@ -400,7 +400,7 @@ TQStringVariantMap MediaManager::undecryptByNode(const TQString &deviceNode)
400 400
 		result["result"] = false;
401 401
 		return result;
402 402
 	}
403
-	return undecrypt(medium->id());
403
+	return lock(medium->id());
404 404
 }
405 405
 
406 406
 TQString MediaManager::nameForLabel(const TQString &label)

+ 4
- 4
tdeioslave/media/mediamanager/mediamanager.h View File

@@ -49,13 +49,13 @@ k_dcop:
49 49
 
50 50
 	TQStringVariantMap mount(const TQString &uid);
51 51
 	TQStringVariantMap unmount(const TQString &uid);
52
-	TQStringVariantMap decrypt(const TQString &uid, const TQString &password);
53
-	TQStringVariantMap undecrypt(const TQString &uid);
52
+	TQStringVariantMap unlock(const TQString &uid, const TQString &password);
53
+	TQStringVariantMap lock(const TQString &uid);
54 54
 
55 55
 	TQStringVariantMap mountByNode(const TQString &deviceNode);
56 56
 	TQStringVariantMap unmountByNode(const TQString &deviceNode);
57
-	TQStringVariantMap decryptByNode(const TQString &deviceNode, const TQString &password);
58
-	TQStringVariantMap undecryptByNode(const TQString &deviceNode);
57
+	TQStringVariantMap unlockByNode(const TQString &deviceNode, const TQString &password);
58
+	TQStringVariantMap lockByNode(const TQString &deviceNode);
59 59
 
60 60
 	TQString nameForLabel(const TQString &label);
61 61
 	ASYNC setUserLabel(const TQString &name, const TQString &label);

+ 12
- 12
tdeioslave/media/mediamanager/tdehardwarebackend.cpp View File

@@ -55,7 +55,7 @@
55 55
 TDEBackend::TDEBackend(MediaList &list, TQObject* parent)
56 56
     : TQObject()
57 57
     , BackendBase(list)
58
-    , m_decryptDialog(0)
58
+    , m_unlockDialog(0)
59 59
     , m_parent(parent)
60 60
 {
61 61
 	// Initialize the TDE device manager
@@ -929,7 +929,7 @@ TQStringList TDEBackend::mountoptions(const TQString &name)
929 929
 	}
930 930
 
931 931
 	if (medium->isEncrypted()) {
932
-		// if not decrypted yet then there are no mountoptions
932
+		// if not unlocked yet then there are no mountoptions
933 933
 		return TQStringList();
934 934
 	}
935 935
 
@@ -1177,7 +1177,7 @@ bool TDEBackend::setMountoptions(const TQString &name, const TQStringList &optio
1177 1177
 }
1178 1178
 
1179 1179
 void TDEBackend::slotPasswordReady() {
1180
-	m_decryptionPassword = m_decryptDialog->getPassword();
1180
+	m_decryptionPassword = m_unlockDialog->getPassword();
1181 1181
 	m_decryptPasswordValid = true;
1182 1182
 }
1183 1183
 
@@ -1267,22 +1267,22 @@ TQStringVariantMap TDEBackend::mount(const Medium *medium)
1267 1267
 		while (continue_trying_to_decrypt == true) {
1268 1268
 			m_decryptPasswordValid = false;
1269 1269
 
1270
-			m_decryptDialog = new Dialog(sdevice->deviceNode(), iconName);
1271
-			m_decryptDialog->show();
1270
+			m_unlockDialog = new Dialog(sdevice->deviceNode(), iconName);
1271
+			m_unlockDialog->show();
1272 1272
 
1273
-			connect(m_decryptDialog, TQT_SIGNAL (user1Clicked()), this, TQT_SLOT (slotPasswordReady()));
1274
-			connect(m_decryptDialog, TQT_SIGNAL (cancelClicked()), this, TQT_SLOT (slotPasswordCancel()));
1275
-			connect(this, TQT_SIGNAL (signalDecryptionPasswordError(TQString)), m_decryptDialog, TQT_SLOT (slotDialogError(TQString)));
1273
+			connect(m_unlockDialog, TQT_SIGNAL (user1Clicked()), this, TQT_SLOT (slotPasswordReady()));
1274
+			connect(m_unlockDialog, TQT_SIGNAL (cancelClicked()), this, TQT_SLOT (slotPasswordCancel()));
1275
+			connect(this, TQT_SIGNAL (signalDecryptionPasswordError(TQString)), m_unlockDialog, TQT_SLOT (slotDialogError(TQString)));
1276 1276
 
1277 1277
 			while (m_decryptPasswordValid == false) {
1278 1278
 				tqApp->processEvents();
1279 1279
 			}
1280 1280
 
1281
-			m_decryptDialog->setEnabled(false);
1281
+			m_unlockDialog->setEnabled(false);
1282 1282
 			tqApp->processEvents();
1283 1283
 
1284 1284
 			if (m_decryptionPassword.isNull()) {
1285
-				delete m_decryptDialog;
1285
+				delete m_unlockDialog;
1286 1286
 				result["errStr"] = i18n("Decryption aborted");
1287 1287
 				result["result"] = false;
1288 1288
 				return result;
@@ -1317,7 +1317,7 @@ TQStringVariantMap TDEBackend::mount(const Medium *medium)
1317 1317
 					if (mountResult.contains("retCode") && mountResult["retCode"].toInt() == 25600) {
1318 1318
 						// Probable LUKS failure
1319 1319
 						// Retry
1320
-						m_decryptDialog->setEnabled(true);
1320
+						m_unlockDialog->setEnabled(true);
1321 1321
 						continue_trying_to_decrypt = true;
1322 1322
 					}
1323 1323
 					else {
@@ -1334,7 +1334,7 @@ TQStringVariantMap TDEBackend::mount(const Medium *medium)
1334 1334
 					continue_trying_to_decrypt = false;
1335 1335
 				}
1336 1336
 
1337
-				delete m_decryptDialog;
1337
+				delete m_unlockDialog;
1338 1338
 			}
1339 1339
 		}
1340 1340
 	}

+ 3
- 3
tdeioslave/media/mediamanager/tdehardwarebackend.h View File

@@ -71,8 +71,8 @@ public:
71 71
 	TQStringVariantMap mount(const TQString &id);
72 72
 	TQStringVariantMap mount(const Medium *medium);
73 73
 	TQStringVariantMap unmount(const TQString &id);
74
-// 	TQStringVariantMap decrypt(const TQString &id, const TQString &password);
75
-// 	TQStringVariantMap undecrypt(const TQString &id);
74
+// 	TQStringVariantMap unlock(const TQString &id, const TQString &password);
75
+// 	TQStringVariantMap lock(const TQString &id);
76 76
 
77 77
 private:
78 78
 	/**
@@ -138,7 +138,7 @@ private:
138 138
 	TQString driveUDIFromDeviceUID(TQString uuid);
139 139
 
140 140
 	// Decryption
141
-	Dialog* m_decryptDialog;
141
+	Dialog* m_unlockDialog;
142 142
 	TQString m_decryptionPassword;
143 143
 	bool m_decryptPasswordValid;
144 144
 

Loading…
Cancel
Save