diff --git a/MUtilities_VS2013.vcxproj b/MUtilities_VS2013.vcxproj
index 03d0d9d..8ae0cf5 100644
--- a/MUtilities_VS2013.vcxproj
+++ b/MUtilities_VS2013.vcxproj
@@ -15,6 +15,8 @@
+
+
@@ -27,7 +29,6 @@
-
@@ -57,6 +58,20 @@
+
+
+ Document
+ "$(QTDIR)\bin\rcc.exe" -o "$(SolutionDir)tmp\$(ProjectName)\QRC_%(Filename).cpp" -name "%(Filename)" "%(FullPath)"
+ "$(QTDIR)\bin\rcc.exe" -o "$(SolutionDir)tmp\$(ProjectName)\QRC_%(Filename).cpp" -name "%(Filename)" "%(FullPath)"
+ "$(QTDIR)\bin\rcc.exe" -o "$(SolutionDir)tmp\$(ProjectName)\QRC_%(Filename).cpp" -name "%(Filename)" "%(FullPath)"
+ RCC "$(SolutionDir)tmp\$(ProjectName)\QRC_%(Filename).cpp"
+ RCC "$(SolutionDir)tmp\$(ProjectName)\QRC_%(Filename).cpp"
+ RCC "$(SolutionDir)tmp\$(ProjectName)\QRC_%(Filename).cpp"
+ $(SolutionDir)tmp\$(ProjectName)\QRC_%(Filename).cpp;%(Outputs)
+ $(SolutionDir)tmp\$(ProjectName)\QRC_%(Filename).cpp;%(Outputs)
+ $(SolutionDir)tmp\$(ProjectName)\QRC_%(Filename).cpp;%(Outputs)
+
+
{55405FE1-149F-434C-9D72-4B64348D2A08}
Win32Proj
diff --git a/MUtilities_VS2013.vcxproj.filters b/MUtilities_VS2013.vcxproj.filters
index ef79cac..17a0908 100644
--- a/MUtilities_VS2013.vcxproj.filters
+++ b/MUtilities_VS2013.vcxproj.filters
@@ -36,9 +36,6 @@
Source Files
-
- Source Files\Generated
-
Source Files
@@ -66,6 +63,12 @@
Source Files\3rd Party
+
+ Source Files\Generated
+
+
+ Source Files\Generated
+
@@ -118,5 +121,8 @@
Public Headers
+
+ Resource Files
+
\ No newline at end of file
diff --git a/res/Resource.qrc b/res/Resource.qrc
new file mode 100644
index 0000000..728a58a
--- /dev/null
+++ b/res/Resource.qrc
@@ -0,0 +1,6 @@
+
+
+
+ icons/bug.png
+
+
diff --git a/res/icons/bug.png b/res/icons/bug.png
new file mode 100644
index 0000000..2d5fb90
Binary files /dev/null and b/res/icons/bug.png differ
diff --git a/src/Startup.cpp b/src/Startup.cpp
index 16da7a4..1558982 100644
--- a/src/Startup.cpp
+++ b/src/Startup.cpp
@@ -242,6 +242,9 @@ bool MUtils::Startup::init_qt(int &argc, char **argv, const QString &appName)
}
}
+ //Setup console icon
+ MUtils::Terminal::set_icon(QIcon(":/mutils/icons/bug.png"));
+
//Enable larger/smaller font size
double fontScaleFactor = 1.0;
if(arguments.contains("--huge-font", Qt::CaseInsensitive)) fontScaleFactor = 1.500;
diff --git a/src/Terminal_Win32.cpp b/src/Terminal_Win32.cpp
index b3ba9d9..f46ab57 100644
--- a/src/Terminal_Win32.cpp
+++ b/src/Terminal_Win32.cpp
@@ -339,7 +339,7 @@ void MUtils::Terminal::set_icon(const QIcon &icon)
{
MUtils::Internal::CSLocker lock(g_terminal_lock);
- if(!(icon.isNull() || MUtils::OS::running_on_wine()))
+ if(g_terminal_attached && (!(icon.isNull() || MUtils::OS::running_on_wine())))
{
QLibrary kernel32("kernel32.dll");
if(kernel32.load())
diff --git a/src/Version.cpp b/src/Version.cpp
index dbbc9a4..5c3d9d8 100644
--- a/src/Version.cpp
+++ b/src/Version.cpp
@@ -29,10 +29,6 @@
#include
#include "Config.h"
-#ifdef _MSC_VER
-#define _snscanf(X, Y, Z, ...) _snscanf_s((X), (Y), (Z), __VA_ARGS__)
-#endif
-
///////////////////////////////////////////////////////////////////////////////
// HELPER FUNCTIONS
///////////////////////////////////////////////////////////////////////////////
@@ -45,7 +41,7 @@ static int month_str2int(const char *str)
for(int j = 0; j < 12; j++)
{
- if(!_strcmpi(str, g_months_lut[j]))
+ if(!_strnicmp(str, g_months_lut[j], 3))
{
ret = j+1;
break;
@@ -57,40 +53,27 @@ static int month_str2int(const char *str)
static const QDate decode_date_str(const char *const date_str) //Mmm dd yyyy
{
- bool ok = true;
int date[3] = {0, 0, 0};
- char buffer[12];
- strcpy_s(buffer, 12, date_str);
- buffer[3] = buffer[6] = '\0';
-
- ok = ok && ((date[1] = month_str2int(&buffer[0])) > 0);
- ok = ok && (sscanf_s(&buffer[4], "%d", &date[2]) == 1);
- ok = ok && (sscanf_s(&buffer[7], "%d", &date[0]) == 1);
-
- if(!ok)
+ if(sscanf_s(date_str, "%*3s %2d %4d", &date[2], &date[0]) != 2)
{
MUTILS_THROW("Internal error: Date format could not be recognized!");
}
-
+
+ if((date[1] = month_str2int(date_str)) < 1)
+ {
+ MUTILS_THROW("Internal error: Date format could not be recognized!");
+ }
+
//qWarning("MUtils::Version::build_date: y=%d, m=%d, d=%d", date[0], date[1], date[2]);
return QDate(date[0], date[1], date[2]);
}
static const QTime decode_time_str(const char *const time_str) //hh:mm:ss
{
- bool ok = true;
int time[3] = {0, 0, 0};
- char buffer[9];
- strcpy_s(buffer, 9, time_str);
- buffer[2] = buffer[5] = '\0';
-
- ok = ok && (sscanf_s(&time_str[0], "%d", &time[0]) == 1);
- ok = ok && (sscanf_s(&time_str[3], "%d", &time[1]) == 1);
- ok = ok && (sscanf_s(&time_str[6], "%d", &time[2]) == 1);
-
- if(!ok)
+ if(sscanf_s(time_str, "%2d:%2d:%2d", &time[0], &time[1], &time[2]) != 3)
{
MUTILS_THROW("Internal error: Time format could not be recognized!");
}