mirror of https://github.com/procxx/kepka.git
				
				
				
			Alpha 1.0.1 for Windows: Qt bugfix backported for large files write.
Also the initial background saved as JPG to reduce the Telegram.exe file size below 32 MB. Currently deployed versions can't autoupdate to a file that is larger than 32 MB due to a critical Qt bug.
This commit is contained in:
		
							parent
							
								
									041e366df7
								
							
						
					
					
						commit
						8f31e1ab31
					
				|  | @ -16,6 +16,25 @@ index eec9e1f..7ae53c7 100644 | |||
|  QMAKE_CFLAGS_YACC       = | ||||
|  QMAKE_CFLAGS_LTCG       = -GL | ||||
|  QMAKE_CFLAGS_SSE2       = -arch:SSE2 | ||||
| diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
 | ||||
| index 391fbcc..d07802b 100644
 | ||||
| --- a/src/corelib/io/qfsfileengine_win.cpp
 | ||||
| +++ b/src/corelib/io/qfsfileengine_win.cpp
 | ||||
| @@ -427,11 +427,12 @@ qint64 QFSFileEnginePrivate::nativeWrite(const char *data, qint64 len)
 | ||||
|   | ||||
|      // Writing on Windows fails with ERROR_NO_SYSTEM_RESOURCES when | ||||
|      // the chunks are too large, so we limit the block size to 32MB. | ||||
| -    const DWORD blockSize = DWORD(qMin(bytesToWrite, qint64(32 * 1024 * 1024)));
 | ||||
|      qint64 totalWritten = 0; | ||||
|      do { | ||||
| +        // Patch: backport critical bugfix from '683c9bc4a8' commit.
 | ||||
| +        const DWORD currentBlockSize = DWORD(qMin(bytesToWrite, qint64(32 * 1024 * 1024)));
 | ||||
|          DWORD bytesWritten; | ||||
| -        if (!WriteFile(fileHandle, data + totalWritten, blockSize, &bytesWritten, NULL)) {
 | ||||
| +        if (!WriteFile(fileHandle, data + totalWritten, currentBlockSize, &bytesWritten, NULL)) {
 | ||||
|              if (totalWritten == 0) { | ||||
|                  // Note: Only return error if the first WriteFile failed. | ||||
|                  q->setError(QFile::WriteError, qt_error_string()); | ||||
| diff --git a/src/corelib/tools/qunicodetables.cpp b/src/corelib/tools/qunicodetables.cpp
 | ||||
| index 14e4fd1..0619a17 100644
 | ||||
| --- a/src/corelib/tools/qunicodetables.cpp
 | ||||
|  |  | |||
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 136 KiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 197 KiB | 
|  | @ -5,7 +5,7 @@ | |||
|     <file>art/fonts/OpenSans-Semibold.ttf</file> | ||||
|     <file>art/newmsg.wav</file> | ||||
|     <file>art/bg.jpg</file> | ||||
|     <file>art/bg_initial.png</file> | ||||
|     <file>art/bg_initial.jpg</file> | ||||
|     <file>art/icon256.png</file> | ||||
|     <file>art/iconbig256.png</file> | ||||
|     <file>art/sunrise.jpg</file> | ||||
|  |  | |||
|  | @ -76,7 +76,7 @@ BackgroundBox::Inner::Inner(QWidget *parent) : TWidget(parent) | |||
| void BackgroundBox::Inner::gotWallpapers(const MTPVector<MTPWallPaper> &result) { | ||||
| 	App::WallPapers wallpapers; | ||||
| 
 | ||||
| 	auto oldBackground = ImagePtr(qsl(":/gui/art/bg_initial.png")); | ||||
| 	auto oldBackground = ImagePtr(qsl(":/gui/art/bg_initial.jpg")); | ||||
| 	wallpapers.push_back(App::WallPaper(Window::Theme::kInitialBackground, oldBackground, oldBackground)); | ||||
| 	auto &v = result.c_vector().v; | ||||
| 	for_const (auto &w, v) { | ||||
|  |  | |||
|  | @ -400,7 +400,7 @@ void ChatBackground::setImage(int32 id, QImage &&image) { | |||
| 		setPreparedImage(std_::move(image)); | ||||
| 	} else { | ||||
| 		if (_id == kInitialBackground) { | ||||
| 			image.load(qsl(":/gui/art/bg_initial.png")); | ||||
| 			image.load(qsl(":/gui/art/bg_initial.jpg")); | ||||
| 			if (cRetina()) { | ||||
| 				image = image.scaledToWidth(image.width() * 2, Qt::SmoothTransformation); | ||||
| 			} else if (cScale() != dbisOne) { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue