author | llornkcor <llornkcor> | 2004-07-10 01:59:00 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-07-10 01:59:00 (UTC) |
commit | 9a51654b784192af0b02536e308f62bf5a5ae57c (patch) (unidiff) | |
tree | 16ec1ec15173f76d1c0134d63b03aafb89e484a8 | |
parent | 9c40b0465fc9d553077f020bed889bb1ac1a472f (diff) | |
download | opie-9a51654b784192af0b02536e308f62bf5a5ae57c.zip opie-9a51654b784192af0b02536e308f62bf5a5ae57c.tar.gz opie-9a51654b784192af0b02536e308f62bf5a5ae57c.tar.bz2 |
spelling
-rw-r--r-- | noncore/apps/zsafe/zsafe.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index 824b841..0864293 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp | |||
@@ -1884,97 +1884,97 @@ void ZSafe::resume(int) | |||
1884 | } | 1884 | } |
1885 | } | 1885 | } |
1886 | 1886 | ||
1887 | // ask for password and read again | 1887 | // ask for password and read again |
1888 | openDocument(filename); | 1888 | openDocument(filename); |
1889 | } | 1889 | } |
1890 | } | 1890 | } |
1891 | 1891 | ||
1892 | //--------------------------------------------- | 1892 | //--------------------------------------------- |
1893 | 1893 | ||
1894 | 1894 | ||
1895 | bool ZSafe::openDocument(const char* _filename, const char* ) | 1895 | bool ZSafe::openDocument(const char* _filename, const char* ) |
1896 | { | 1896 | { |
1897 | int retval; | 1897 | int retval; |
1898 | char* entry[FIELD_SIZE]; | 1898 | char* entry[FIELD_SIZE]; |
1899 | // #ifndef WIN32 | 1899 | // #ifndef WIN32 |
1900 | int validationFlag = conf->readNumEntry(APP_KEY+"valzsafe", 1); | 1900 | int validationFlag = conf->readNumEntry(APP_KEY+"valzsafe", 1); |
1901 | // #else | 1901 | // #else |
1902 | // int validationFlag = 1; | 1902 | // int validationFlag = 1; |
1903 | // #endif | 1903 | // #endif |
1904 | 1904 | ||
1905 | int pwdOk = 0; | 1905 | int pwdOk = 0; |
1906 | int numberOfTries = 3; | 1906 | int numberOfTries = 3; |
1907 | for (int i=0; i < numberOfTries; i++) | 1907 | for (int i=0; i < numberOfTries; i++) |
1908 | { | 1908 | { |
1909 | QFile f(_filename); | 1909 | QFile f(_filename); |
1910 | if (f.exists()) | 1910 | if (f.exists()) |
1911 | { | 1911 | { |
1912 | // ask with a dialog for the password | 1912 | // ask with a dialog for the password |
1913 | if (m_password.isEmpty()) | 1913 | if (m_password.isEmpty()) |
1914 | getDocPassword(tr("Enter Password")); | 1914 | getDocPassword(tr("Enter Password")); |
1915 | if (m_password.isEmpty() && validationFlag == 0) | 1915 | if (m_password.isEmpty() && validationFlag == 0) |
1916 | { | 1916 | { |
1917 | #ifndef NO_OPIE | 1917 | #ifndef NO_OPIE |
1918 | owarn << "Wrong password" << oendl; | 1918 | owarn << "Wrong password" << oendl; |
1919 | #else | 1919 | #else |
1920 | qWarning ("Wrong password"); | 1920 | qWarning ("Wrong password"); |
1921 | #endif | 1921 | #endif |
1922 | QMessageBox::critical( 0, tr("ZSafe"), | 1922 | QMessageBox::critical( 0, tr("ZSafe"), |
1923 | tr("Wrong password.\n\nZSafe will now exit.") ); | 1923 | tr("Wrong password.\n\nZSafe will now exit.") ); |
1924 | exitZs (1); | 1924 | exitZs (1); |
1925 | } | 1925 | } |
1926 | 1926 | ||
1927 | retval = loadInit(_filename, m_password); | 1927 | retval = loadInit(_filename, m_password); |
1928 | if (retval != PWERR_GOOD) | 1928 | if (retval != PWERR_GOOD) |
1929 | { | 1929 | { |
1930 | #ifndef NO_OPIE | 1930 | #ifndef NO_OPIE |
1931 | owarn << "Error loading Document" << oendl; | 1931 | owarn << "Error loading Document" << oendl; |
1932 | #lese | 1932 | #else |
1933 | qWarning ("Error loading Document"); | 1933 | qWarning ("Error loading Document"); |
1934 | #endif | 1934 | #endif |
1935 | return false; | 1935 | return false; |
1936 | } | 1936 | } |
1937 | } | 1937 | } |
1938 | else | 1938 | else |
1939 | { | 1939 | { |
1940 | #ifdef WIN32 | 1940 | #ifdef WIN32 |
1941 | this->setCaption("Qt ZSafe"); | 1941 | this->setCaption("Qt ZSafe"); |
1942 | #else | 1942 | #else |
1943 | this->setCaption("ZSafe"); | 1943 | this->setCaption("ZSafe"); |
1944 | #endif | 1944 | #endif |
1945 | filename = ""; | 1945 | filename = ""; |
1946 | return false; | 1946 | return false; |
1947 | } | 1947 | } |
1948 | 1948 | ||
1949 | 1949 | ||
1950 | // load the validation entry | 1950 | // load the validation entry |
1951 | if (validationFlag == 0) | 1951 | if (validationFlag == 0) |
1952 | { | 1952 | { |
1953 | pwdOk = 1; | 1953 | pwdOk = 1; |
1954 | break; | 1954 | break; |
1955 | } | 1955 | } |
1956 | 1956 | ||
1957 | retval = loadEntry(entry); | 1957 | retval = loadEntry(entry); |
1958 | if (retval == 1 && | 1958 | if (retval == 1 && |
1959 | !strcmp (entry[0], "ZSAFECATEGORY") && | 1959 | !strcmp (entry[0], "ZSAFECATEGORY") && |
1960 | !strcmp (entry[1], "name") && | 1960 | !strcmp (entry[1], "name") && |
1961 | !strcmp (entry[2], "username") && | 1961 | !strcmp (entry[2], "username") && |
1962 | !strcmp (entry[3], "password") && | 1962 | !strcmp (entry[3], "password") && |
1963 | !strcmp (entry[4], "comment") ) | 1963 | !strcmp (entry[4], "comment") ) |
1964 | { | 1964 | { |
1965 | for (int count = 0; count < FIELD_SIZE; count++) free(entry[count]); | 1965 | for (int count = 0; count < FIELD_SIZE; count++) free(entry[count]); |
1966 | pwdOk = 1; | 1966 | pwdOk = 1; |
1967 | break; | 1967 | break; |
1968 | } | 1968 | } |
1969 | else | 1969 | else |
1970 | // for (int count = 0; count < FIELD_SIZE; count++) free(entry[count]); | 1970 | // for (int count = 0; count < FIELD_SIZE; count++) free(entry[count]); |
1971 | fclose (fd); | 1971 | fclose (fd); |
1972 | m_password = ""; | 1972 | m_password = ""; |
1973 | 1973 | ||
1974 | if (i < numberOfTries - 1) | 1974 | if (i < numberOfTries - 1) |
1975 | { | 1975 | { |
1976 | switch( QMessageBox::warning( this, tr("ZSafe"), | 1976 | switch( QMessageBox::warning( this, tr("ZSafe"), |
1977 | tr("Wrong password.\nEnter again?"), | 1977 | tr("Wrong password.\nEnter again?"), |
1978 | tr("&Yes"), tr("&No."), | 1978 | tr("&Yes"), tr("&No."), |
1979 | 0 | 1979 | 0 |
1980 | ) ) | 1980 | ) ) |