Fixed inconsistencies in navigation when removing invalid files
This commit is contained in:
		
							parent
							
								
									1b089bc2fa
								
							
						
					
					
						commit
						450c1ed9b5
					
				
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							| @ -1,4 +1,4 @@ | |||||||
| VERSION = git-20131005 | VERSION = git-20131021 | ||||||
| 
 | 
 | ||||||
| PREFIX    = /usr/local | PREFIX    = /usr/local | ||||||
| MANPREFIX = $(PREFIX)/share/man | MANPREFIX = $(PREFIX)/share/man | ||||||
|  | |||||||
							
								
								
									
										9
									
								
								main.c
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								main.c
									
									
									
									
									
								
							| @ -160,6 +160,8 @@ void remove_file(int n, bool manual) | |||||||
| 	filecnt--; | 	filecnt--; | ||||||
| 	if (n < tns.cnt) | 	if (n < tns.cnt) | ||||||
| 		tns.cnt--; | 		tns.cnt--; | ||||||
|  | 	if (n < alternate) | ||||||
|  | 		alternate--; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void set_timeout(timeout_f handler, int time, bool overwrite) | void set_timeout(timeout_f handler, int time, bool overwrite) | ||||||
| @ -287,15 +289,18 @@ void load_image(int new) | |||||||
| 
 | 
 | ||||||
| 	win_set_cursor(&win, CURSOR_WATCH); | 	win_set_cursor(&win, CURSOR_WATCH); | ||||||
| 
 | 
 | ||||||
|  | 	if (new != fileidx) | ||||||
|  | 		alternate = fileidx; | ||||||
|  | 
 | ||||||
| 	img_close(&img, false); | 	img_close(&img, false); | ||||||
| 	while (!img_load(&img, &files[new])) { | 	while (!img_load(&img, &files[new])) { | ||||||
| 		remove_file(new, false); | 		remove_file(new, false); | ||||||
| 		if (new >= filecnt) | 		if (new >= filecnt) | ||||||
| 			new = filecnt - 1; | 			new = filecnt - 1; | ||||||
|  | 		else if (new < fileidx) | ||||||
|  | 			new--; | ||||||
| 	} | 	} | ||||||
| 
 |  | ||||||
| 	files[new].loaded = true; | 	files[new].loaded = true; | ||||||
| 	alternate = fileidx; |  | ||||||
| 	fileidx = new; | 	fileidx = new; | ||||||
| 
 | 
 | ||||||
| 	info.open = false; | 	info.open = false; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Bert Münnich
						Bert Münnich