diff Modules/Collected.lua @ 78:bd80e4b4042f

Fixed time spent tracker.
author Zerotorescue
date Thu, 16 Sep 2010 16:21:30 +0200
parents 364791db5503
children 5fe1f61452a1
line wrap: on
line diff
--- a/Modules/Collected.lua	Wed Sep 15 23:52:24 2010 +0200
+++ b/Modules/Collected.lua	Thu Sep 16 16:21:30 2010 +0200
@@ -226,7 +226,7 @@
 	
 	local timeSpent, tempSessionTimeSpent;
 	if timeStarted then
-		timeSpent = ( GetTime() - timeStarted );
+		timeSpent = ceil( GetTime() - timeStarted );
 		
 		if self.db.profile.sessionSummary and self.db.profile.trackTimeSpent then
 			tempSessionTimeSpent = ( sessionTimeSpent + timeSpent );
@@ -236,6 +236,8 @@
 				sessionTimeSpent = tempSessionTimeSpent;
 			end
 		end
+		
+		self:Debug(timeSpent);
 	end
 	
 	-- Did we record any mail being opened?
@@ -256,9 +258,9 @@
 		local timeSpentMinutes = floor( timeSpent / 60 );
 		local timeSpentSeconds = ( timeSpent % 60 );
 		if timeSpentMinutes ~= 0 then
-			printMessage = printMessage .. format(L["Spent %d minutes and %d seconds collecting mail."], mailOpened, timeSpentMinutes, timeSpentSeconds) .. " ";
+			printMessage = printMessage .. format(L["Spent %d minutes and %d seconds collecting mail."], timeSpentMinutes, timeSpentSeconds) .. " ";
 		else
-			printMessage = printMessage .. format(L["Spent %d seconds collecting mail."], mailOpened, timeSpentSeconds) .. " ";
+			printMessage = printMessage .. format(L["Spent %d seconds collecting mail."], timeSpentSeconds) .. " ";
 		end
 	end
 	
@@ -287,9 +289,9 @@
 				local timeSpentMinutes = floor( tempSessionTimeSpent / 60 );
 				local timeSpentSeconds = ( tempSessionTimeSpent % 60 );
 				if timeSpentMinutes ~= 0 then
-					printMessage = printMessage .. format(L["Collected a total of %d mail within %d minutes and %d seconds this session."], mailOpened, timeSpentMinutes, timeSpentSeconds) .. " ";
+					printMessage = printMessage .. format(L["Collected a total of %d mail within %d minutes and %d seconds this session."], sessionMailOpened, timeSpentMinutes, timeSpentSeconds) .. " ";
 				else
-					printMessage = printMessage .. format(L["Collected a total of %d mail within %d seconds this session."], mailOpened, timeSpentSeconds) .. " ";
+					printMessage = printMessage .. format(L["Collected a total of %d mail within %d seconds this session."], sessionMailOpened, timeSpentSeconds) .. " ";
 				end
 			else
 				printMessage = printMessage .. format(L["Collected a total of %d mail this session."], sessionMailOpened) .. " ";
@@ -298,9 +300,9 @@
 			local timeSpentMinutes = floor( tempSessionTimeSpent / 60 );
 			local timeSpentSeconds = ( tempSessionTimeSpent % 60 );
 			if timeSpentMinutes ~= 0 then
-				printMessage = printMessage .. format(L["Spent %d minutes and %d seconds collecting mail this session."], mailOpened, timeSpentMinutes, timeSpentSeconds) .. " ";
+				printMessage = printMessage .. format(L["Spent %d minutes and %d seconds collecting mail this session."], timeSpentMinutes, timeSpentSeconds) .. " ";
 			else
-				printMessage = printMessage .. format(L["Spent %d seconds collecting mail this session."], mailOpened, timeSpentSeconds) .. " ";
+				printMessage = printMessage .. format(L["Spent %d seconds collecting mail this session."], timeSpentSeconds) .. " ";
 			end
 		end